Permalink
Browse files

Provide alternate ways to add new subscriptions

Using:

 - CTRL+N shortcut
 - the menu item
 - the toolbar button
  • Loading branch information...
1 parent 1ff23de commit 62be90843ab670827f412cd0230f63a3ea776c4f @igstan committed Oct 29, 2010
Showing with 10 additions and 3 deletions.
  1. +8 −2 Nemira/MainWindow.xaml
  2. +2 −1 Nemira/MainWindow.xaml.cs
View
@@ -12,6 +12,10 @@
FocusManager.FocusedElement="{Binding ElementName=subscriptions}"
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
+ <Window.CommandBindings>
+ <CommandBinding Command="New" Executed="AddSubscription"/>
+ </Window.CommandBindings>
+
<Window.Resources>
<Style TargetType="{x:Type Button}" x:Key="DeleteSubscriptionButton">
<Setter Property="Content">
@@ -66,7 +70,9 @@
<Menu Width="Auto" Padding="0,0,0,1" DockPanel.Dock="Top">
<MenuItem Header="_File">
- <MenuItem InputGestureText="Ctrl+N" Header="New Feed">
+ <MenuItem InputGestureText="Ctrl+N"
+ Header="New Subscription"
+ Command="New">
<MenuItem.ToolTip>
<ToolTip>Subscribe to a new feed</ToolTip>
</MenuItem.ToolTip>
@@ -90,7 +96,7 @@
Background="Transparent">
<ToolBar Margin="0,2,0,2">
<Button Padding="5,5,5,5"
- Click="OnAddSubscription"
+ Command="New"
ToolTip="Add Subscription">
<Image Source="Images/feed_add.png"/>
</Button>
@@ -6,6 +6,7 @@
using System.Text;
using System.Windows;
using System.Windows.Documents;
+using System.Windows.Input;
using System.Windows.Navigation;
using GoogleReader.API;
@@ -122,7 +123,7 @@ private void OnHyperlinkMouseLeave(object sender, RoutedEventArgs e)
status.Text = "Done";
}
- private void OnAddSubscription(object sender, RoutedEventArgs e)
+ private void AddSubscription(object sender, ExecutedRoutedEventArgs e)
{
var addSubscriptionDialog = new AddSubscription();
addSubscriptionDialog.Owner = this;

0 comments on commit 62be908

Please sign in to comment.