Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

Commit

Permalink
Changed ComboBox size. Added edit button and about.
Browse files Browse the repository at this point in the history
Added edit button to command bar, but removed functionality for the time being. Added an about button in nav and removed settings button.
  • Loading branch information
Unknown committed Apr 11, 2018
1 parent c0fc873 commit 23b70c7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
13 changes: 7 additions & 6 deletions AnneProKeyboard/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
x:Name="AnneNav"
IsPaneOpen="false"
ExpandedModeThresholdWidth="1920"
IsSettingsVisible="{Binding ElementName=settingsCheck,Path=IsChecked}"
IsSettingsVisible="False"
IsTabStop="false"
Background="#FF1f1f1f"
Header="Layout">
Expand All @@ -29,11 +29,12 @@
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="Transparent"
OverflowButtonVisibility="Collapsed">
OverflowButtonVisibility="Collapsed" Margin="0,0,15,0" FontSize="11">
<AppBarButton Icon="Add" Click="ProfileAddButton_Click"/>
<AppBarSeparator/>
<AppBarButton Icon="Delete" Click="ProfileDeleteButton_Click"/>
</CommandBar>
<AppBarButton Icon="Edit" Click="ProfileEditButton_Click"/>
<AppBarButton Icon="Delete" Click="ProfileDeleteButton_Click"/>
</CommandBar>
</DataTemplate>
</NavigationView.HeaderTemplate>
<Frame x:Name="ContentFrame">
Expand All @@ -46,8 +47,8 @@
<Grid.Resources>
<converters:BooleanToVisibilityConverter x:Key="Bool2VisibilityConverter" />
</Grid.Resources>
<ComboBox x:Name="ProfilesCombo" Height="44" Width="296" Grid.Row="0"
ItemsSource="{x:Bind KeyboardProfiles}" HorizontalAlignment="Right" Margin="0,-46,185,0" SelectionChanged="ProfilesCombo_SelectionChanged" Loaded="ProfilesCombo_Loaded">
<ComboBox x:Name="ProfilesCombo" Height="35" Width="270" Grid.Row="0"
ItemsSource="{x:Bind KeyboardProfiles}" HorizontalAlignment="Right" Margin="0,-41,262,0" SelectionChanged="ProfilesCombo_SelectionChanged" Loaded="ProfilesCombo_Loaded">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Grid.Row="3">
Expand Down
33 changes: 21 additions & 12 deletions AnneProKeyboard/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ private void ProfileAddButton_Click(object sender, RoutedEventArgs e)

private void ProfileEditButton_Click(object sender, RoutedEventArgs e)
{
Button button = (Button)sender;
FrameworkElement parent = (FrameworkElement)button.Parent;
TextBox textbox = (TextBox)parent.FindName("ProfileNameTextbox");
textbox.IsEnabled = true;
textbox.Visibility = Visibility.Visible;
FocusState focus_state = FocusState.Keyboard;
textbox.Focus(focus_state);

TextBlock textblock = (TextBlock)parent.FindName("ProfileNameTextblock");
textblock.Visibility = Visibility.Collapsed;

this.RenamingProfile = this._keyboardProfiles[(int)button.Tag];
//Button button = (Button)sender;
//FrameworkElement parent = (FrameworkElement)button.Parent;
//TextBox textbox = (TextBox)parent.FindName("ProfileNameTextbox");
//textbox.IsEnabled = true;
//textbox.Visibility = Visibility.Visible;
//FocusState focus_state = FocusState.Keyboard;
//textbox.Focus(focus_state);

//TextBlock textblock = (TextBlock)parent.FindName("ProfileNameTextblock");
//textblock.Visibility = Visibility.Collapsed;

//this.RenamingProfile = this._keyboardProfiles[(int)button.Tag];
SaveProfiles();
}

Expand Down Expand Up @@ -610,6 +610,10 @@ private void AnneNav_SelectionChanged(NavigationView sender, NavigationViewSelec
case "lighting":
_frame.Content = lightingPage;
break;

case "about":
_frame.Content = aboutPage;
break;
}
}
}
Expand All @@ -636,6 +640,11 @@ private void AnneNav_ItemInvoked(NavigationView sender, NavigationViewItemInvoke
sender.Header = "Lighting";
_frame.Content = lightingPage;
break;

case "About":
sender.Header = "About";
_frame.Content = aboutPage;
break;
}
}
}
Expand Down

0 comments on commit 23b70c7

Please sign in to comment.