mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-17 17:23:23 -05:00
- Add support for filtering by category
- Break up main window into partials instead of using regions
This commit is contained in:
311
Application/MainWindow/MainWindow.xaml
Normal file
311
Application/MainWindow/MainWindow.xaml
Normal file
@@ -0,0 +1,311 @@
|
||||
<windows:SnappingWindow x:Class="FeedCenter.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:properties="clr-namespace:FeedCenter.Properties"
|
||||
xmlns:windows="clr-namespace:Common.Wpf.Windows;assembly=Common.Wpf"
|
||||
xmlns:toolbar="clr-namespace:Common.Wpf.Toolbar;assembly=Common.Wpf"
|
||||
xmlns:splitButton="clr-namespace:Common.Wpf.Toolbar.SplitButton;assembly=Common.Wpf"
|
||||
xmlns:linkControl="clr-namespace:Common.Wpf.LinkControl;assembly=Common.Wpf"
|
||||
xmlns:htmlTextBlock="clr-namespace:Common.Wpf.HtmlTextBlock;assembly=Common.Wpf"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:nameBasedGrid="clr-namespace:NameBasedGrid;assembly=NameBasedGrid"
|
||||
Title="MainWindow"
|
||||
Height="360"
|
||||
Width="252"
|
||||
WindowStyle="None"
|
||||
ResizeMode="NoResize"
|
||||
Background="{x:Static SystemColors.DesktopBrush}"
|
||||
AllowDrop="True"
|
||||
DragOver="HandleDragOver"
|
||||
Drop="HandleDragDrop"
|
||||
ShowInTaskbar="False">
|
||||
<Window.Resources>
|
||||
<Style TargetType="{x:Type ToolBar}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToolBar}">
|
||||
<ToolBarPanel IsItemsHost="True"
|
||||
Margin="0,1,2,2"
|
||||
SnapsToDevicePixels="True" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<Border BorderBrush="{x:Static SystemColors.ActiveBorderBrush}"
|
||||
BorderThickness="1"
|
||||
Name="WindowBorder"
|
||||
Padding="0"
|
||||
Background="{x:Static SystemColors.DesktopBrush}">
|
||||
<nameBasedGrid:NameBasedGrid Name="MainGrid">
|
||||
<nameBasedGrid:NameBasedGrid.RowDefinitions>
|
||||
<!-- ReSharper disable UnusedMember.Global -->
|
||||
<nameBasedGrid:ColumnOrRow Size="Auto"
|
||||
Name="HeaderRow" />
|
||||
<nameBasedGrid:ColumnOrRow Size="Auto"
|
||||
Name="NewVersionRow" />
|
||||
<nameBasedGrid:ColumnOrRow Size="Auto"
|
||||
Name="CategoryRow" />
|
||||
<nameBasedGrid:ColumnOrRow Size="Auto"
|
||||
Name="FeedRow" />
|
||||
<nameBasedGrid:ColumnOrRow Size="Auto"
|
||||
Name="TopToolbarRow" />
|
||||
<nameBasedGrid:ColumnOrRow Size="*"
|
||||
Name="FeedListRow" />
|
||||
<nameBasedGrid:ColumnOrRow Size="Auto"
|
||||
Name="ProgressRow" />
|
||||
<nameBasedGrid:ColumnOrRow Size="Auto"
|
||||
Name="BottomToolbarRow" />
|
||||
<nameBasedGrid:ColumnOrRow Size="Auto"
|
||||
Name="FeedErrorsRow" />
|
||||
<!-- ReSharper restore UnusedMember.Global -->
|
||||
</nameBasedGrid:NameBasedGrid.RowDefinitions>
|
||||
<Grid Height="21"
|
||||
nameBasedGrid:NameBasedGrid.Row="HeaderRow">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="21" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="{x:Static properties:Resources.ApplicationDisplayName}"
|
||||
Name="HeaderLabel"
|
||||
Padding="3,0"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
MouseLeftButtonDown="HandleHeaderLabelMouseLeftButtonDown"
|
||||
VerticalContentAlignment="Center"
|
||||
Grid.Column="0" />
|
||||
<Button Width="13"
|
||||
Height="13"
|
||||
Click="HandleCloseButtonClick"
|
||||
FontFamily="Marlett"
|
||||
Content="r"
|
||||
FontSize="8"
|
||||
Grid.Column="1"></Button>
|
||||
</Grid>
|
||||
<linkControl:LinkControl Name="NewVersionLink"
|
||||
Height="21"
|
||||
nameBasedGrid:NameBasedGrid.Row="NewVersionRow"
|
||||
Text="{x:Static properties:Resources.NewVersionLink}"
|
||||
Background="AntiqueWhite"
|
||||
VerticalContentAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Visibility="Collapsed"
|
||||
Click="HandleNewVersionLinkClick">
|
||||
</linkControl:LinkControl>
|
||||
<Grid Name="CategoryGrid"
|
||||
Height="21"
|
||||
nameBasedGrid:NameBasedGrid.Row="CategoryRow"
|
||||
Visibility="Visible">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="21" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="*Category Name"
|
||||
Name="CategoryLabel"
|
||||
Padding="3,0"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
Width="Auto"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Grid.Column="0" />
|
||||
<Button Width="13"
|
||||
Height="13"
|
||||
Click="HandleCategoryButtonClick"
|
||||
FontFamily="Marlett"
|
||||
Content="u"
|
||||
FontSize="8"
|
||||
Grid.Column="1" />
|
||||
</Grid>
|
||||
<Grid Height="21"
|
||||
nameBasedGrid:NameBasedGrid.Row="FeedRow">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="21" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="*Feed Name"
|
||||
Name="FeedLabel"
|
||||
Padding="3,0"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
Width="Auto"
|
||||
Cursor="Hand"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
MouseDown="HandleFeedLabelMouseDown"
|
||||
Grid.Column="0" />
|
||||
<Button Name="FeedButton"
|
||||
Width="13"
|
||||
Height="13"
|
||||
Click="HandleFeedButtonClick"
|
||||
FontFamily="Marlett"
|
||||
Content="u"
|
||||
FontSize="8"
|
||||
Grid.Column="1" />
|
||||
</Grid>
|
||||
<ListBox Name="LinkTextList"
|
||||
BorderThickness="0"
|
||||
Background="{x:Static SystemColors.DesktopBrush}"
|
||||
MouseUp="HandleLinkTextListMouseUp"
|
||||
Foreground="White"
|
||||
nameBasedGrid:NameBasedGrid.Row="FeedListRow"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||
<ListBoxItem Content="Test item" />
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<htmlTextBlock:HtmlTextBlock Html="{Binding}"
|
||||
TextWrapping="Wrap"
|
||||
Margin="0,1" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border BorderThickness="{TemplateBinding Border.BorderThickness}"
|
||||
Padding="{TemplateBinding Control.Padding}"
|
||||
BorderBrush="{TemplateBinding Border.BorderBrush}"
|
||||
Background="{TemplateBinding Panel.Background}"
|
||||
Name="Bd"
|
||||
SnapsToDevicePixels="True">
|
||||
<ContentPresenter Content="{TemplateBinding ContentControl.Content}"
|
||||
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
|
||||
ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
|
||||
HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
|
||||
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Selector.IsMouseOver">
|
||||
<Trigger.Value>
|
||||
<system:Boolean>True</system:Boolean>
|
||||
</Trigger.Value>
|
||||
<Setter Property="Panel.Background"
|
||||
TargetName="Bd">
|
||||
<Setter.Value>
|
||||
<DynamicResource ResourceKey="{x:Static SystemColors.HighlightBrushKey}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="TextElement.Foreground">
|
||||
<Setter.Value>
|
||||
<DynamicResource ResourceKey="{x:Static SystemColors.HighlightTextBrushKey}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Panel.Cursor"
|
||||
TargetName="Bd"
|
||||
Value="Hand">
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<EventSetter Event="MouseDoubleClick"
|
||||
Handler="HandleItemMouseDoubleClick" />
|
||||
<EventSetter Event="MouseUp"
|
||||
Handler="HandleItemMouseUp" />
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
</ListBox>
|
||||
<ProgressBar Name="FeedReadProgress"
|
||||
Height="15"
|
||||
Visibility="Collapsed"
|
||||
nameBasedGrid:NameBasedGrid.Row="ProgressRow" />
|
||||
<ToolBarTray Name="NavigationToolbarTray"
|
||||
Background="Transparent"
|
||||
Orientation="Horizontal"
|
||||
nameBasedGrid:NameBasedGrid.Row="TopToolbarRow">
|
||||
<ToolBar ToolBarTray.IsLocked="True"
|
||||
Background="Transparent"
|
||||
ToolBar.OverflowMode="Never">
|
||||
<toolbar:ImageButton Height="20"
|
||||
Width="20"
|
||||
Name="PreviousToolbarButton"
|
||||
Click="HandlePreviousToolbarButtonClick"
|
||||
ToolTip="{x:Static properties:Resources.previousToolbarButton}"
|
||||
ImageSource="../Resources/Left.ico" />
|
||||
<toolbar:ImageButton Height="20"
|
||||
Width="20"
|
||||
Name="NextToolbarButton"
|
||||
Click="HandleNextToolbarButtonClick"
|
||||
ToolTip="{x:Static properties:Resources.nextToolbarButton}"
|
||||
ImageSource="../Resources/Right.ico" />
|
||||
<splitButton:SplitButton Name="RefreshToolbarButton"
|
||||
Image="../Resources/Rss-Download.ico"
|
||||
ToolTip="{x:Static properties:Resources.refreshAllToolbarButton}"
|
||||
Height="20"
|
||||
MinWidth="35"
|
||||
Margin="5,0,0,0"
|
||||
Click="HandleRefreshToolbarButtonClick">
|
||||
<splitButton:SplitButton.DropDownContextMenu>
|
||||
<ContextMenu MenuItem.Click="HandleRefreshMenuItemClick">
|
||||
<MenuItem Name="MenuRefreshAll"
|
||||
Header="{x:Static properties:Resources.refreshAllToolbarButton}" />
|
||||
<MenuItem Name="MenuRefresh"
|
||||
Header="{x:Static properties:Resources.refreshToolbarButton}" />
|
||||
</ContextMenu>
|
||||
</splitButton:SplitButton.DropDownContextMenu>
|
||||
</splitButton:SplitButton>
|
||||
<splitButton:SplitButton Name="OpenAllToolbarButton"
|
||||
Image="../Resources/News.ico"
|
||||
ToolTip="{x:Static properties:Resources.openAllMultipleToolbarButton}"
|
||||
Height="20"
|
||||
MinWidth="35"
|
||||
Margin="5,0,0,0"
|
||||
Click="HandleOpenAllToolbarButtonClick">
|
||||
<splitButton:SplitButton.DropDownContextMenu>
|
||||
<ContextMenu MenuItem.Click="HandleOpenAllMenuItemClick">
|
||||
<MenuItem Name="MenuOpenAllMultiplePages"
|
||||
Header="{x:Static properties:Resources.openAllMultipleToolbarButton}" />
|
||||
<MenuItem Name="MenuOpenAllSinglePage"
|
||||
Header="{x:Static properties:Resources.openAllSingleToolbarButton}" />
|
||||
</ContextMenu>
|
||||
</splitButton:SplitButton.DropDownContextMenu>
|
||||
</splitButton:SplitButton>
|
||||
<toolbar:ImageButton Height="20"
|
||||
Width="20"
|
||||
Margin="5,0,0,0"
|
||||
Name="MarkReadToolbarButton"
|
||||
Click="HandleMarkReadToolbarButtonClick"
|
||||
ToolTip="{x:Static properties:Resources.markReadToolbarButton}"
|
||||
ImageSource="../Resources/Comments-edit.ico" />
|
||||
<splitButton:SplitButton Height="20"
|
||||
MinWidth="35"
|
||||
Margin="5,0,0,0"
|
||||
Click="HandleOptionsToolbarButtonClick"
|
||||
ToolTip="{x:Static properties:Resources.optionsToolbarButton}"
|
||||
Image="../Resources/Compile.ico">
|
||||
<splitButton:SplitButton.DropDownContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="{x:Static properties:Resources.lockWindowCheckBox}"
|
||||
IsCheckable="True"
|
||||
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=WindowLocked}" />
|
||||
<Separator />
|
||||
<MenuItem Header="{x:Static properties:Resources.CurrentFeed}">
|
||||
<MenuItem Header="{x:Static properties:Resources.EditMenu}"
|
||||
Click="HandleEditCurrentFeedMenuItemClick" />
|
||||
<MenuItem Header="{x:Static properties:Resources.DeleteMenu}"
|
||||
Click="HandleDeleteCurrentFeedMenuItemClick" />
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</splitButton:SplitButton.DropDownContextMenu>
|
||||
</splitButton:SplitButton>
|
||||
</ToolBar>
|
||||
</ToolBarTray>
|
||||
<linkControl:LinkControl Name="FeedErrorsLink"
|
||||
Height="21"
|
||||
nameBasedGrid:NameBasedGrid.Row="FeedErrorsRow"
|
||||
Text="{x:Static properties:Resources.FeedErrorsLink}"
|
||||
ToolTip="{x:Static properties:Resources.showErrorsToolbarButton}"
|
||||
Background="AntiqueWhite"
|
||||
VerticalContentAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Visibility="Collapsed"
|
||||
Click="HandleShowErrorsButtonClick">
|
||||
</linkControl:LinkControl>
|
||||
</nameBasedGrid:NameBasedGrid>
|
||||
</Border>
|
||||
</windows:SnappingWindow>
|
||||
Reference in New Issue
Block a user