Permalink
Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
196 lines (186 sloc) 9.62 KB
<Window x:Class="Nemira.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:nemira="clr-namespace:Nemira"
xmlns:reader="clr-namespace:GoogleReader.API;assembly=GoogleReader.API"
Title="Nemira"
WindowState="Maximized"
MinWidth="500"
MinHeight="400"
ResizeMode="CanResizeWithGrip"
TextOptions.TextFormattingMode="Display"
FocusManager.FocusedElement="{Binding ElementName=subscriptions}"
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<Window.CommandBindings>
<CommandBinding Command="New" Executed="AddSubscription"/>
<CommandBinding Command="Delete" Executed="RemoveSubscription" CanExecute="CanRemoveSubscription"/>
</Window.CommandBindings>
<Window.Resources>
<Style TargetType="{x:Type Button}" x:Key="DeleteSubscriptionButton">
<Setter Property="Content">
<Setter.Value>
<Image>
<Image.Source>
<FormatConvertedBitmap Source="Images/feed_delete.png" DestinationFormat="Gray8" />
</Image.Source>
</Image>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Content">
<Setter.Value>
<Image Source="Images/feed_delete.png"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type Button}" x:Key="RenameSubscriptionButton">
<Setter Property="Content">
<Setter.Value>
<Image>
<Image.Source>
<FormatConvertedBitmap Source="Images/feed_edit.png" DestinationFormat="Gray8" />
</Image.Source>
</Image>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Content">
<Setter.Value>
<Image Source="Images/feed_edit.png"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<DockPanel HorizontalAlignment="Stretch" Margin="0,0,0,0">
<StatusBar DockPanel.Dock="Bottom" Name="statusBar">
<StatusBarItem>
<TextBlock Name="status">Done</TextBlock>
</StatusBarItem>
</StatusBar>
<Menu Width="Auto" Padding="0,0,0,1" DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem InputGestureText="Ctrl+N"
Header="New Subscription"
Command="New">
<MenuItem.ToolTip>
<ToolTip>Subscribe to a new feed</ToolTip>
</MenuItem.ToolTip>
</MenuItem>
<MenuItem InputGestureText="Del"
Header="Remove Subscription"
Command="Delete">
<MenuItem.ToolTip>
<ToolTip>Remove selected feed subscription</ToolTip>
</MenuItem.ToolTip>
</MenuItem>
</MenuItem>
<MenuItem Header="_Edit"/>
<MenuItem Header="_View"/>
<MenuItem Header="_Help"/>
</Menu>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="275"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<DockPanel VerticalAlignment="Stretch" Grid.Column="0">
<ToolBarTray DockPanel.Dock="Top"
IsLocked="True"
Background="Transparent">
<ToolBar Margin="0,2,0,2">
<Button Padding="5,5,5,5"
Command="New"
ToolTip="Add Subscription">
<Image Source="Images/feed_add.png"/>
</Button>
<Separator/>
<Button IsEnabled="False"
Padding="5,5,5,5"
Name="editSubscription"
ToolTip="Rename Subscription"
Click="OnRenameSubscription"
Style="{DynamicResource RenameSubscriptionButton}"/>
<Separator/>
<Button IsEnabled="False"
Padding="5,5,5,5"
Name="deleteSubscription"
ToolTip="Delete Subscription"
Command="Delete"
Style="{DynamicResource DeleteSubscriptionButton}"/>
</ToolBar>
</ToolBarTray>
<TreeView Name="subscriptions"
TreeViewItem.Selected="OnSelectedFeed"
TreeViewItem.Unselected="OnUnselectedFeed"
TreeViewItem.Expanded="OnExpandedSubscription"
FontSize="13"
FontFamily="Tahoma"
TextOptions.TextRenderingMode="ClearType"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type reader:Subscription}" ItemsSource="{Binding Items}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
<Image Source="Images/feed.png" Margin="0,0,5,0"/>
<TextBlock Text="{Binding Path=Title}" Padding="2,2,2,2">
<TextBlock.ToolTip>
<ToolTip Content="{Binding Path=Title}"
FontSize="13"
FontFamily="Tahoma"/>
</TextBlock.ToolTip>
</TextBlock>
</StackPanel>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type reader:SubscriptionItem}">
<TextBlock Text="{Binding Path=Title}" Padding="1,1,1,1">
<TextBlock.ToolTip>
<ToolTip Content="{Binding Path=Title}"
FontSize="13"
FontFamily="Tahoma"/>
</TextBlock.ToolTip>
</TextBlock>
</DataTemplate>
</TreeView.Resources>
</TreeView>
</DockPanel>
<GridSplitter Grid.Column="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
<DockPanel VerticalAlignment="Stretch" Grid.Column="2">
<Label FontSize="22"
FontWeight="Thin"
FontFamily="Tahoma"
TextOptions.TextFormattingMode="Ideal"
DockPanel.Dock="Top">
<Label.Content>
<Hyperlink Name="sourceHyperlink"
Foreground="Black"
TextDecorations="None"
RequestNavigate="OpenHyperlink"
MouseEnter="OnHyperlinkMouseEnter"
MouseLeave="OnHyperlinkMouseLeave">
<TextBlock Name="feedTitle" Text="Nemira Feed Reader">
<TextBlock.ToolTip>
<ToolTip Name="feedItemTooltip"
Content="Nemira Feed Reader"
FontSize="13"
FontFamily="Tahoma"
TextOptions.TextFormattingMode="Display"/>
</TextBlock.ToolTip>
</TextBlock>
</Hyperlink>
</Label.Content>
</Label>
<WebBrowser Name="contentArea" Source="about:blank"/>
</DockPanel>
</Grid>
</DockPanel>
</Grid>
</Window>