More styling

This commit is contained in:
watsonb8 2019-12-01 20:20:55 -08:00
parent 89d7d65d8d
commit 6bb4b5fdd5
10 changed files with 109 additions and 15 deletions

View File

@ -4,3 +4,8 @@
vertical-align: middle; vertical-align: middle;
word-wrap: break-word; word-wrap: break-word;
} }
HeaderLaberStyle {
text-align: left;
color: red;
}

View File

@ -14,10 +14,17 @@
SelectionEnabled="True" SelectionEnabled="True"
RowHeight="30" RowHeight="30"
BorderColor="#3a3a3a" BorderColor="#3a3a3a"
HeaderFontSize="14" BorderThickness="0"
HeaderHeight="45" HeaderHeight="40"
HeaderTextColor="White"
HeaderBackground="#222222"> HeaderBackground="#222222">
<dg:DataGrid.HeaderLabelStyle>
<Style TargetType="Label">
<Setter Property="HorizontalOptions" Value="Start"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="TextColor" Value="White"/>
</Style>
</dg:DataGrid.HeaderLabelStyle>
<dg:DataGrid.GestureRecognizers> <dg:DataGrid.GestureRecognizers>
<TapGestureRecognizer <TapGestureRecognizer
NumberOfTapsRequired="2"/> NumberOfTapsRequired="2"/>
@ -59,6 +66,7 @@
</DataTemplate> </DataTemplate>
</dg:DataGridColumn.CellTemplate> </dg:DataGridColumn.CellTemplate>
</dg:DataGridColumn> </dg:DataGridColumn>
<dg:DataGridColumn <dg:DataGridColumn
Title="Artist" Title="Artist"
PropertyName="Metadata.Artist" PropertyName="Metadata.Artist"

View File

@ -0,0 +1,10 @@
Label {
color: darkgray;
text-align: left;
vertical-align: middle;
word-wrap: break-word;
}
#MediaInfoLayout label {
margin-left: 20;
}

View File

@ -3,6 +3,10 @@
xmlns="http://xamarin.com/schemas/2014/forms" xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Aurora.Design.Components.MediaPlayer.Player"> x:Class="Aurora.Design.Components.MediaPlayer.Player">
<ContentView.Resources>
<StyleSheet
Source="Player.css"/>
</ContentView.Resources>
<ContentView.Content> <ContentView.Content>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -10,16 +14,24 @@
Width="100"/> Width="100"/>
<ColumnDefinition <ColumnDefinition
Width="*"/> Width="*"/>
<ColumnDefinition
Width="100"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackLayout <StackLayout
x:Name="MediaInfoLayout"
HorizontalOptions="StartAndExpand"
Grid.Column="0"> Grid.Column="0">
<Label <Label
x:Name="SongTitleLabel"/> x:Name="SongTitleLabel"
LineBreakMode="TailTruncation"/>
<Label <Label
x:Name="ArtistNameLabel"/> x:Name="ArtistNameLabel"
LineBreakMode="TailTruncation"/>
</StackLayout> </StackLayout>
<StackLayout <StackLayout
x:Name="PlayerControlLayout"
Grid.Column="1" Grid.Column="1"
HorizontalOptions="Center"
Orientation="Horizontal"> Orientation="Horizontal">
<Button <Button
Text="Previous" Text="Previous"

View File

@ -2,7 +2,6 @@
<ContentView <ContentView
xmlns="http://xamarin.com/schemas/2014/forms" xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:behaviors="clr-namespace:Aurora.Design.Behaviors"
x:Class="Aurora.Design.Components.NavigationMenu.NavigationMenu"> x:Class="Aurora.Design.Components.NavigationMenu.NavigationMenu">
<ContentView.Resources> <ContentView.Resources>
<StyleSheet <StyleSheet

View File

@ -11,16 +11,34 @@ namespace Aurora.Design.Components.NavigationMenu
{ {
InitializeComponent(); InitializeComponent();
ListView = MenuItemsListView; ListView = MenuItemsListView;
ListView.ItemSelected += ListView_ItemSelected;
} }
private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{ {
throw new NotImplementedException(); this.SelectedItem = e.SelectedItem as NavigationItem;
} }
public ListView ListView; public ListView ListView;
public static readonly BindableProperty SelectedItemProperty =
BindableProperty.Create(propertyName: nameof(SelectedItem),
returnType: typeof(NavigationItem),
declaringType: typeof(NavigationMenu),
defaultBindingMode: BindingMode.OneWayToSource);
public NavigationItem SelectedItem
{
get
{
return (NavigationItem)GetValue(SelectedItemProperty);
}
set
{
SetValue(SelectedItemProperty, value);
}
}
public static readonly BindableProperty ItemsProperty = public static readonly BindableProperty ItemsProperty =
BindableProperty.Create(propertyName: nameof(Items), BindableProperty.Create(propertyName: nameof(Items),

View File

@ -11,3 +11,14 @@
margin-top: 2; margin-top: 2;
margin-bottom: 2; margin-bottom: 2;
} }
#TitleContainer {
margin-top: 10;
}
#TitleContainer Label {
color: white;
margin-left: 155;
font-size: 18;
vertical-align: bottom;
}

View File

@ -12,6 +12,7 @@
</ContentPage.Resources> </ContentPage.Resources>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
<RowDefinition Height="50"/> <RowDefinition Height="50"/>
@ -19,12 +20,20 @@
<!--Header--> <!--Header-->
<StackLayout <StackLayout
x:Name="Header" x:Name="Header"
Grid.Row="0"
Orientation="Horizontal"> Orientation="Horizontal">
<Entry Text="Search"/> <Entry Text="Search"/>
</StackLayout> </StackLayout>
<!--Title-->
<StackLayout
Grid.Row="1"
x:Name="TitleContainer">
<Label Text="{Binding Title}" TextColor="White"/>
</StackLayout>
<!--Library Grid--> <!--Library Grid-->
<Grid Grid.Row="1"> <Grid Grid.Row="2">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/> <ColumnDefinition Width="150"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
@ -33,7 +42,8 @@
<navigation:NavigationMenu <navigation:NavigationMenu
Grid.Column="0" Grid.Column="0"
x:Name="MasterPage" x:Name="MasterPage"
Items="{Binding Pages}"/> Items="{Binding Pages}"
SelectedItem="{Binding SelectedItem}"/>
<views:PageContainer <views:PageContainer
Grid.Column="1" Grid.Column="1"
@ -45,8 +55,7 @@
<!--Music Player--> <!--Music Player-->
<mp:Player <mp:Player
x:Name="Player" x:Name="Player"
Grid.Row="2" Grid.Row="3"
HorizontalOptions="Center"
HeightRequest="50"/> HeightRequest="50"/>
</Grid> </Grid>

View File

@ -93,8 +93,6 @@ namespace Aurora.Design.Views.Main
AssignPlayerControls(vm); AssignPlayerControls(vm);
_viewContent.Content = view; _viewContent.Content = view;
MasterPage.ListView.SelectedItem = null;
} }
/// <summary> /// <summary>
@ -129,8 +127,8 @@ namespace Aurora.Design.Views.Main
vm.OnActive(); vm.OnActive();
_viewContent.Content = view; _viewContent.Content = view;
MasterPage.ListView.SelectedItem = firstNavItem;
MasterPage.ListView.SelectedItem = screenList.FirstOrDefault();
} }
/// <summary> /// <summary>

View File

@ -28,6 +28,30 @@ namespace Aurora.Design.Views.MainView
} }
} }
private NavigationItem _selectedItem;
public NavigationItem SelectedItem
{
get
{
return _selectedItem;
}
set
{
SetProperty(ref _selectedItem, value);
OnPropertyChanged("Title");
}
}
public string Title
{
get
{
return (_selectedItem != null && !string.IsNullOrWhiteSpace(_selectedItem.Title)) ?
_selectedItem.Title : "";
}
}
public MainViewModel() public MainViewModel()
{ {
_pages = new ObservableCollection<NavigationItem>(new[] _pages = new ObservableCollection<NavigationItem>(new[]