diff options
author | marcinzelent <marcin@zelent.net> | 2017-04-28 17:57:00 +0200 |
---|---|---|
committer | marcinzelent <marcin@zelent.net> | 2017-04-28 17:57:00 +0200 |
commit | 77651496e175e97ab92224c0d69b30d270dd6c88 (patch) | |
tree | fb6a4ee887b48cbb9ef00a177bf8db79c139c174 | |
parent | 27ec40e6a7150b0e23151bcbef036d8c759365fb (diff) |
Fixed AppShell.
-rw-r--r-- | ApartmentManager/ApartmentManager/ApartmentManager.csproj | 16 | ||||
-rw-r--r-- | ApartmentManager/ApartmentManager/App.xaml | 9 | ||||
-rw-r--r-- | ApartmentManager/ApartmentManager/AppShell.xaml | 11 | ||||
-rw-r--r-- | ApartmentManager/ApartmentManager/AppShell.xaml.cs | 23 | ||||
-rw-r--r-- | ApartmentManager/ApartmentManager/Styles/Styles.xaml | 557 | ||||
-rw-r--r-- | ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs | 27 |
6 files changed, 616 insertions, 27 deletions
diff --git a/ApartmentManager/ApartmentManager/ApartmentManager.csproj b/ApartmentManager/ApartmentManager/ApartmentManager.csproj index 3768365..1f2eda3 100644 --- a/ApartmentManager/ApartmentManager/ApartmentManager.csproj +++ b/ApartmentManager/ApartmentManager/ApartmentManager.csproj @@ -138,6 +138,22 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </ApplicationDefinition> + <Page Include="AppShell.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Styles\Styles.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="View\ApartmentPage.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="View\ApartmentPlanPage.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="View\LoginPage.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> diff --git a/ApartmentManager/ApartmentManager/App.xaml b/ApartmentManager/ApartmentManager/App.xaml index e4c9342..37c4add 100644 --- a/ApartmentManager/ApartmentManager/App.xaml +++ b/ApartmentManager/ApartmentManager/App.xaml @@ -5,4 +5,13 @@ xmlns:local="using:ApartmentManager" RequestedTheme="Light"> + <Application.Resources> + <ResourceDictionary> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="/Styles/Styles.xaml" /> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </Application.Resources> + </Application> diff --git a/ApartmentManager/ApartmentManager/AppShell.xaml b/ApartmentManager/ApartmentManager/AppShell.xaml index 28d40e3..e775b93 100644 --- a/ApartmentManager/ApartmentManager/AppShell.xaml +++ b/ApartmentManager/ApartmentManager/AppShell.xaml @@ -19,7 +19,7 @@ --> <Page.Resources> - <DataTemplate x:Key="NavMenuItemTemplate" x:DataType="local:NavMenuItem" > + <DataTemplate x:Key="NavMenuItemTemplate" x:DataType="model:NavMenuItem" > <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="48" /> @@ -73,14 +73,11 @@ <Image Grid.Column="0" Source="/Assets/Images/fvacanceslogo.png" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="200,5,0,5" Height="40" /> <StackPanel x:Name="StackPanel1" Grid.Column="1" Orientation="Horizontal"> - <AppBarButton Icon="AddFriend" Label="Sign up" Style="{StaticResource SignButtonStyle}" Width="Auto" Click="GoToCreateUserView"/> - <AppBarButton Icon="Contact" Label="Sign in" Style="{StaticResource SignButtonStyle}" Width="Auto" Click="GoToLoginView"/> + <AppBarButton Icon="AddFriend" Label="Sign up" Style="{StaticResource SignButtonStyle}" Width="Auto"/> + <AppBarButton Icon="Contact" Label="Sign in" Style="{StaticResource SignButtonStyle}" Width="Auto"/> </StackPanel> <StackPanel x:Name="StackPanel2" Grid.Column="1" Orientation="Horizontal" Visibility="Collapsed"> - <StackPanel.DataContext> - <viewModel:LoginUserViewModel/> - </StackPanel.DataContext> - <AppBarButton Icon="Contact" Label="My account" Style="{StaticResource SignButtonStyle}" Width="Auto" Click="GoToUserView"/> + <AppBarButton Icon="Contact" Label="My account" Style="{StaticResource SignButtonStyle}" Width="Auto"/> <AppBarButton Icon="Sync" Label="Logout" Style="{StaticResource SignButtonStyle}" Width="Auto" Command="{Binding LogOutCommand}"/> </StackPanel> </Grid> diff --git a/ApartmentManager/ApartmentManager/AppShell.xaml.cs b/ApartmentManager/ApartmentManager/AppShell.xaml.cs index ed86a46..0bd4f7f 100644 --- a/ApartmentManager/ApartmentManager/AppShell.xaml.cs +++ b/ApartmentManager/ApartmentManager/AppShell.xaml.cs @@ -23,7 +23,7 @@ namespace ApartmentManager { Symbol = Symbol.Home, Label = "Home", - DestPage = typeof(LoginPage), + DestPage = typeof(ApartmentPage), IsSelected = true } }); @@ -39,11 +39,11 @@ namespace ApartmentManager { InitializeComponent(); - List<NavMenuItem> topNavMenuItems = navMenuItems.GetRange(0, 3); - List<NavMenuItem> bottomNavMenuItems = navMenuItems.GetRange(3, 2); + List<NavMenuItem> topNavMenuItems = navMenuItems.GetRange(0, 1); + // List<NavMenuItem> bottomNavMenuItems = navMenuItems.GetRange(3, 2); NavMenuList.ItemsSource = topNavMenuItems; - NavMenuList2.ItemsSource = bottomNavMenuItems; + // NavMenuList2.ItemsSource = bottomNavMenuItems; } public Frame AppFrame { get { return Frame; } } @@ -140,20 +140,5 @@ namespace ApartmentManager StackPanel1.Visibility = Visibility.Collapsed; StackPanel2.Visibility = Visibility.Visible; } - - private void GoToLoginView(object sender, RoutedEventArgs e) - { - Frame.Navigate(typeof(LoginView)); - } - - private void GoToCreateUserView(object sender, RoutedEventArgs e) - { - Frame.Navigate(typeof(CreateUserView)); - } - - private void GoToUserView(object sender, RoutedEventArgs e) - { - Frame.Navigate(typeof(UserView)); - } } }
\ No newline at end of file diff --git a/ApartmentManager/ApartmentManager/Styles/Styles.xaml b/ApartmentManager/ApartmentManager/Styles/Styles.xaml new file mode 100644 index 0000000..0b53355 --- /dev/null +++ b/ApartmentManager/ApartmentManager/Styles/Styles.xaml @@ -0,0 +1,557 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:interop="using:Windows.UI.Xaml.Interop" + xmlns:controls="using:FranceVacances.Controls"> + + <SolidColorBrush x:Key="SplitViewLightDismissOverlayBackground" Opacity="0.6" Color="{ThemeResource SystemChromeLowColor}"/> + + <Style x:Key="SplitViewTogglePaneButtonStyle" TargetType="ToggleButton"> + <Setter Property="FontSize" Value="16" /> + <Setter Property="FontFamily" Value="{StaticResource SymbolThemeFontFamily}" /> + <Setter Property="MinHeight" Value="48" /> + <Setter Property="MinWidth" Value="48" /> + <Setter Property="Margin" Value="0,0,0,0" /> + <Setter Property="Padding" Value="0" /> + <Setter Property="HorizontalAlignment" Value="Left" /> + <Setter Property="VerticalAlignment" Value="Top" /> + <Setter Property="HorizontalContentAlignment" Value="Center" /> + <Setter Property="VerticalContentAlignment" Value="Center" /> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" /> + <Setter Property="Content" Value="" /> + <Setter Property="AutomationProperties.Name" Value="Navigation" /> + <Setter Property="UseSystemFocusVisuals" Value="True" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ToggleButton"> + <Grid x:Name="LayoutRoot" + Background="{TemplateBinding Background}"> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal" /> + <VisualState x:Name="PointerOver"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Grid.Background)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + <VisualState x:Name="Pressed"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Grid.Background)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + <VisualState x:Name="Disabled"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(TextBlock.Foreground)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}"/> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + <VisualState x:Name="Checked"/> + <VisualState x:Name="CheckedPointerOver"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Grid.Background)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + <VisualState x:Name="CheckedPressed"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Grid.Background)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + <VisualState x:Name="CheckedDisabled"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(TextBlock.Foreground)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}"/> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + <ContentPresenter x:Name="ContentPresenter" + Content="{TemplateBinding Content}" + Margin="{TemplateBinding Padding}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw" /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="SplitViewPaneButtonStyle" TargetType="Button"> + <Setter Property="Padding" Value="0"/> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="FontFamily" Value="{StaticResource SymbolThemeFontFamily}"/> + <Setter Property="FontSize" Value="16"/> + <Setter Property="MinHeight" Value="48" /> + <Setter Property="MinWidth" Value="48" /> + <Setter Property="HorizontalContentAlignment" Value="Center" /> + <Setter Property="VerticalContentAlignment" Value="Center" /> + <Setter Property="UseSystemFocusVisuals" Value="True"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="Button"> + <Grid x:Name="RootGrid" Background="{TemplateBinding Background}"> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal"> + <Storyboard> + <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/> + </Storyboard> + </VisualState> + <VisualState x:Name="PointerOver"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="RootGrid"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}"/> + </ObjectAnimationUsingKeyFrames> + <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/> + </Storyboard> + </VisualState> + <VisualState x:Name="Pressed"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="RootGrid"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/> + </ObjectAnimationUsingKeyFrames> + <PointerDownThemeAnimation Storyboard.TargetName="RootGrid"/> + </Storyboard> + </VisualState> + <VisualState x:Name="Disabled"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="RootGrid"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ContentPresenter"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledTransparentBrush}"/> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + <ContentPresenter x:Name="ContentPresenter" + AutomationProperties.AccessibilityView="Raw" + Padding="{TemplateBinding Padding}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + Content="{TemplateBinding Content}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="NavMenuItemContainerStyle" TargetType="ListViewItem"> + <Setter Property="MinWidth" Value="{StaticResource SplitViewCompactPaneThemeLength}"/> + <Setter Property="Height" Value="48"/> + <Setter Property="Padding" Value="0"/> + <Setter Property="UseSystemFocusVisuals" Value="True" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ListViewItem"> + <ListViewItemPresenter ContentTransitions="{TemplateBinding ContentTransitions}" + Control.IsTemplateFocusTarget="True" + SelectionCheckMarkVisualEnabled="False" + PointerOverBackground="{ThemeResource SystemControlHighlightListLowBrush}" + SelectedBackground="Transparent" + SelectedForeground="{ThemeResource SystemControlForegroundAccentBrush}" + SelectedPointerOverBackground="{ThemeResource SystemControlHighlightListLowBrush}" + PressedBackground="{ThemeResource SystemControlHighlightListMediumBrush}" + SelectedPressedBackground="{ThemeResource SystemControlHighlightListMediumBrush}" + DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + ContentMargin="{TemplateBinding Padding}"/> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="SignButtonStyle" TargetType="AppBarButton"> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/> + <Setter Property="HorizontalAlignment" Value="Left"/> + <Setter Property="VerticalAlignment" Value="Top"/> + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> + <Setter Property="FontWeight" Value="Normal"/> + <Setter Property="Width" Value="68"/> + <Setter Property="Margin" Value="0,0,0,0"/> + <Setter Property="UseSystemFocusVisuals" Value="True"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="AppBarButton"> + <Grid x:Name="Root" Background="{TemplateBinding Background}" MaxWidth="{TemplateBinding MaxWidth}" MinWidth="{TemplateBinding MinWidth}"> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="ApplicationViewStates"> + <VisualState x:Name="FullSize"/> + <VisualState x:Name="Compact"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="TextLabel"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + <VisualState x:Name="Overflow"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ContentRoot"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="OverflowTextLabel"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + <VisualState x:Name="OverflowWithToggleButtons"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ContentRoot"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="OverflowTextLabel"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="OverflowTextLabel"> + <DiscreteObjectKeyFrame KeyTime="0" Value="38,0,12,0"/> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + </VisualStateGroup> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal"> + <Storyboard> + <PointerUpThemeAnimation Storyboard.TargetName="OverflowTextLabel"/> + </Storyboard> + </VisualState> + <VisualState x:Name="PointerOver"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="Content"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="TextLabel"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="OverflowTextLabel"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/> + </ObjectAnimationUsingKeyFrames> + <PointerUpThemeAnimation Storyboard.TargetName="OverflowTextLabel"/> + </Storyboard> + </VisualState> + <VisualState x:Name="Pressed"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Root"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="Content"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="TextLabel"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="OverflowTextLabel"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/> + </ObjectAnimationUsingKeyFrames> + <PointerDownThemeAnimation Storyboard.TargetName="OverflowTextLabel"/> + </Storyboard> + </VisualState> + <VisualState x:Name="Disabled"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="Content"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="TextLabel"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="OverflowTextLabel"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + </VisualStateGroup> + <VisualStateGroup x:Name="InputModeStates"> + <VisualState x:Name="InputModeDefault"/> + <VisualState x:Name="TouchInputMode"> + <VisualState.Setters> + <Setter Target="OverflowTextLabel.Padding" Value="0,11,0,13"/> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + <StackPanel x:Name="ContentRoot" MinHeight="{ThemeResource AppBarThemeCompactHeight}" Orientation="Horizontal" Padding="15,0,5,0" MinWidth="100"> + <ContentPresenter x:Name="Content" AutomationProperties.AccessibilityView="Raw" Content="{TemplateBinding Icon}" Foreground="{TemplateBinding Foreground}" Height="20" Margin="0"/> + <TextBlock x:Name="TextLabel" Foreground="{TemplateBinding Foreground}" FontSize="12" FontFamily="{TemplateBinding FontFamily}" TextAlignment="Center" TextWrapping="Wrap" Text="{TemplateBinding Label}" VerticalAlignment="Center" Margin="5,0,0,0"/> + </StackPanel> + <TextBlock x:Name="OverflowTextLabel" Foreground="{TemplateBinding Foreground}" FontSize="15" FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="Stretch" Margin="12,0,12,0" Padding="0,5,0,7" TextAlignment="Left" TextWrapping="NoWrap" Text="{TemplateBinding Label}" TextTrimming="Clip" Visibility="Collapsed" VerticalAlignment="Center"/> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + + + <!-- Grid Styles --> + + <!-- Background --> + <ImageBrush x:Name="BackgroundPicture" ImageSource="../Assets/Images/BackgroundImages/parryPeak.jpg"/> + <Style x:Name="GridBackground" TargetType="Grid"> + <Setter Property="Background" Value="{StaticResource BackgroundPicture}"/> + </Style> + + <!-- Category Background --> + <Style x:Key="CategoryBackgroundStyle" TargetType="Image"> + <Setter Property="Grid.RowSpan" Value="3"/> + <Setter Property="Canvas.ZIndex" Value="-1"/> + <Setter Property="Stretch" Value="UniformToFill"/> + </Style> + + <!-- Border Grid --> + <Style x:Name="BorderGridStyle" TargetType="Grid"> + <Setter Property="BorderThickness" Value="2"/> + <Setter Property="BorderBrush" Value="#CCFFFFFF"/> + <Setter Property="Background" Value="DodgerBlue"/> + </Style> + + <!-- Login Grid --> + <Style x:Name="LoginGrid" TargetType="Grid" BasedOn="{StaticResource BorderGridStyle}" > + <Setter Property="VerticalAlignment" Value="Center"/> + <Setter Property="HorizontalAlignment" Value="Center"/> + <Setter Property="Width" Value="400"/> + <Setter Property="Height" Value="250"/> + </Style> + + <!-- Create User Grid --> + <Style x:Name="CreateUserGrid" TargetType="Grid" BasedOn="{StaticResource BorderGridStyle}"> + <Setter Property="VerticalAlignment" Value="Center"/> + <Setter Property="HorizontalAlignment" Value="Center"/> + <Setter Property="MinWidth" Value="400"/> + <Setter Property="Width" Value="600"/> + <Setter Property="Height" Value="950"/> + </Style> + + <!-- Category Grid --> + <Style x:Key="CategoryGridStyle" TargetType="Grid"> + <Setter Property="BorderThickness" Value="1,0,1,1"/> + <Setter Property="BorderBrush" Value="White"/> + </Style> + + <!-- /Grid Styles --> + + <!-- Stackpanel Styles --> + + <!-- Login Stackpanel --> + <Style x:Name="LoginStackpanel" TargetType="StackPanel"> + <Setter Property="VerticalAlignment" Value="Center"/> + <Setter Property="HorizontalAlignment" Value="Center"/> + <Setter Property="Margin" Value="0,0,0,40"/> + <Setter Property="Width" Value="400"/> + </Style> + + <!-- Create User Stackpanel Left --> + + <Style x:Name="CreateUserStackpanelLeft" TargetType="StackPanel"> + <Setter Property="HorizontalAlignment" Value="Stretch"/> + <Setter Property="Margin" Value="10"/> + </Style> + + <!-- Create User Stackpanel Right --> + + <Style x:Name="CreateUserStackpanelRight" TargetType="StackPanel"> + <Setter Property="Margin" Value="10,45,10,10"/> + </Style> + + <!-- /Stackpanel Styles --> + + + <!-- Font Types for TextBlocks --> + + <Style x:Name="ContentFontStyle" TargetType="TextBlock"> + <Setter Property="FontFamily" Value="Segoe UI"/> + </Style> + + <!-- /Font Types TextBlocks --> + + + <!-- TextBlock Styles --> + + <!-- FontStyle for Create User TextBlocks --> + <Style x:Name="CreateUserFontStyle" TargetType="TextBlock" BasedOn="{StaticResource ContentFontStyle}"> + <Setter Property="Foreground" Value="GhostWhite"/> + <Setter Property="Margin" Value="5,10,0,0"/> + </Style> + + <!-- FontStyle for Error TextBlocks --> + + <Style x:Name="ErrorTextFontStyle" TargetType="TextBlock" BasedOn="{StaticResource ContentFontStyle}"> + <Setter Property="VerticalAlignment" Value="Top"/> + <Setter Property="TextWrapping" Value="Wrap"/> + <Setter Property="Foreground" Value="Gold"/> + <Setter Property="Margin" Value="0,0,0,42"/> + </Style> + + <!-- FontStyle for Headline Basic Textblocks --> + + <Style x:Name="HeadlineBasicFontStyle" TargetType="TextBlock" BasedOn="{StaticResource ContentFontStyle}"> + <Setter Property="FontSize" Value="32"/> + <Setter Property="Foreground" Value="White"/> + <Setter Property="FontWeight" Value="Bold"/> + <Setter Property="Height" Value="43"/> + </Style> + + <!-- FontStyle for Headline Login Textblock --> + + <Style x:Name="LoginHeadlineStyle" TargetType="TextBlock" BasedOn="{StaticResource HeadlineBasicFontStyle}"> + <Setter Property="VerticalAlignment" Value="Top"/> + <Setter Property="HorizontalAlignment" Value="Center"/> + <Setter Property="Margin" Value="0,10,0,0"/> + </Style> + + <!-- FontStyle for Headline Create User Textblock --> + + <Style x:Name="CreateUserHeadlineStyle" TargetType="TextBlock" BasedOn="{StaticResource HeadlineBasicFontStyle}"> + <Setter Property="VerticalAlignment" Value="Center"/> + <Setter Property="HorizontalAlignment" Value="Center"/> + <Setter Property="Width" Value="173"/> + </Style> + + <!-- FontStyle for Login Error Textblock --> + <Style x:Name="LoginErrorTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource ContentFontStyle}"> + <Setter Property="VerticalAlignment" Value="Top"/> + <Setter Property="HorizontalAlignment" Value="Center"/> + <Setter Property="Foreground" Value="Gold"/> + <Setter Property="Margin" Value="0,0,0,10"/> + </Style> + + <!-- Category Label Textblock Style --> + <Style x:Key="CategoryLabelStyle" TargetType="TextBlock"> + <Setter Property="Grid.Row" Value="0"/> + <Setter Property="FontFamily" Value="/Assets/Fonts/BreeSerif.ttf#Bree Serif"/> + <Setter Property="FontSize" Value="36"/> + <Setter Property="Foreground" Value="White"/> + <Setter Property="CharacterSpacing" Value="75"/> + <Setter Property="LineStackingStrategy" Value="BlockLineHeight"/> + <Setter Property="TextLineBounds" Value="TrimToCapHeight"/> + <Setter Property="Margin" Value="10,0,0,0"/> + <Setter Property="VerticalAlignment" Value="Bottom"/> + </Style> + + <!-- Category Description Textblock Style --> + <Style x:Key="CategoryDescriptionStyle" TargetType="TextBlock"> + <Setter Property="Grid.Row" Value="1"/> + <Setter Property="FontSize" Value="20"/> + <Setter Property="Foreground" Value="White"/> + <Setter Property="Margin" Value="10,0,20,0"/> + <Setter Property="TextWrapping" Value="WrapWholeWords"/> + </Style> + + <!-- /TextBlock Styles --> + + <!-- TextBox and PasswordBox Styles --> + + <!-- Create User TextBox Style --> + <Style x:Name="CreateUserTextBoxStyle" TargetType="TextBox"> + <Setter Property="BorderBrush" Value="#CCFFFFFF"/> + </Style> + + <!-- Password Standard Style --> + <Style x:Name="PasswordStandardStyle" TargetType="PasswordBox"> + <Setter Property="BorderBrush" Value="#CCFFFFFF"/> + </Style> + + <!-- PasswordBox Login Style --> + <Style x:Name="PasswordLoginStyle" TargetType="PasswordBox" BasedOn="{StaticResource PasswordStandardStyle}"> + <Setter Property="Width" Value="180"/> + <Setter Property="Margin" Value="0,10,0,0"/> + </Style> + + <!-- PasswordBox Create User Style --> + <Style x:Name="CreateUserPasswordBoxStyle" TargetType="PasswordBox" BasedOn="{StaticResource PasswordStandardStyle}"> + </Style> + + <!-- Login TextBox Style --> + <Style x:Name="LoginTextBoxStyle" TargetType="TextBox"> + <Setter Property="Width" Value="180"/> + <Setter Property="Margin" Value="0,10,0,0"/> + <Setter Property="BorderBrush" Value="#CCFFFFFF"/> + </Style> + + <!-- /TextBox and PasswordBox Style --> + + <!-- Button Styles --> + + <!-- Standard Button Style--> + <Style x:Name="StandardButtonStyle" TargetType="Button"> + <Setter Property="BorderBrush" Value="#CCFFFFFF"/> + <Setter Property="Background" Value="Gold"/> + <Setter Property="Height" Value="50"/> + <Setter Property="FontSize" Value="20"/> + <Setter Property="FontWeight" Value="Bold"/> + </Style> + + <!-- Register Here Button Style --> + <Style x:Name="RegisterHereButtonStyle" TargetType="Button"> + <Setter Property="VerticalAlignment" Value="Bottom"/> + <Setter Property="HorizontalAlignment" Value="Left"/> + <Setter Property="Margin" Value="0,0,0,5"/> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="Foreground" Value="Transparent"/> + <Setter Property="BorderBrush" Value="Transparent"/> + <Setter Property="BorderThickness" Value="0"/> + </Style> + + <!-- Login Button Style --> + <Style x:Name="LoginButton" TargetType="Button" BasedOn="{StaticResource StandardButtonStyle}"> + <Setter Property="VerticalAlignment" Value="Bottom"/> + <Setter Property="HorizontalAlignment" Value="Right"/> + <Setter Property="Width" Value="120"/> + <Setter Property="Margin" Value="0,0,10,10"/> + </Style> + + <!-- Create User Button Style --> + <Style x:Name="CreateButtonStyle" TargetType="Button" BasedOn="{StaticResource StandardButtonStyle}"> + <Setter Property="VerticalAlignment" Value="Bottom"/> + <Setter Property="HorizontalAlignment" Value="Center"/> + <Setter Property="Width" Value="250"/> + <Setter Property="Margin" Value="20,100,10,10"/> + </Style> + + + <!-- /Button Styles --> + + <!-- ListViewItem Styles --> + + <!-- Location ListViewItem Style --> + <Style x:Key="LocationStyle" TargetType="ListViewItem"> + <Setter Property="FontFamily" Value="/Assets/Fonts/BreeSerif.ttf#Bree Serif"/> + <Setter Property="FontSize" Value="24"/> + <Setter Property="Foreground" Value="White"/> + </Style> + + <!-- /Listview Item Styles --> + + +</ResourceDictionary> diff --git a/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs b/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs index dcc17ee..6f3a86b 100644 --- a/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs +++ b/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs @@ -29,7 +29,32 @@ namespace ApartmentManager.View private void click(object sender, RoutedEventArgs e) { - Frame.Navigate(typeof(ApartmentPage)); + AppShell appShell = Window.Current.Content as AppShell; + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (appShell == null) + { + // Create a AppShell to act as the navigation context and navigate to the first page + appShell = new AppShell(); + + // Set the default language + appShell.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; + + } + + // Place our app shell in the current Window + Window.Current.Content = appShell; + + if (appShell.AppFrame.Content == null) + { + // When the navigation stack isn't restored, navigate to the first page + // suppressing the initial entrance animation. + appShell.AppFrame.Navigate(typeof(ApartmentPage)); + } + + // Ensure the current window is active + Window.Current.Activate(); } } } |