comparison Chronosv2/source/WidgetLibrary/WidgetLibraryView.xaml @ 10:443821e55f06

Initial cleaned up add from Codeplex files
author stevenh7776 stevenhollidge@hotmail.com
date Tue, 21 Feb 2012 17:25:44 +0700
parents
children
comparison
equal deleted inserted replaced
9:904a9faadf8b 10:443821e55f06
1 <chronos:WidgetElement x:Class="Chronos.WidgetLibrary.WidgetLibraryView"
2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6 xmlns:chronos="http://chronos/schemas/2010/xaml"
7 xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
8 Style="{StaticResource DefaultWidgetStyle}"
9 Title="Widget Library"
10 mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
11
12 <Grid Background="Transparent" Margin="5,5,5,5">
13 <Grid.Resources>
14 <CollectionViewSource x:Key="WidgetsViewSource"
15 Source="{Binding Widgets, Mode=OneWay}">
16 <CollectionViewSource.GroupDescriptions>
17 <PropertyGroupDescription PropertyName="Group" StringComparison="OrdinalIgnoreCase" />
18 </CollectionViewSource.GroupDescriptions>
19 <CollectionViewSource.SortDescriptions>
20 <scm:SortDescription PropertyName="Group"/>
21 </CollectionViewSource.SortDescriptions>
22 </CollectionViewSource>
23 </Grid.Resources>
24 <Grid.RowDefinitions>
25 <RowDefinition Height="Auto" />
26 <RowDefinition Height="*" />
27 <RowDefinition Height="Auto" />
28 </Grid.RowDefinitions>
29
30 <Grid Grid.Row="0">
31 <ComboBox ItemsSource="{Binding Groups, Mode=OneWay}"
32 IsSynchronizedWithCurrentItem="True"
33 SelectedValue="{Binding Path=Filter, Mode=TwoWay}"
34 HorizontalAlignment="Stretch" VerticalAlignment="Center">
35 </ComboBox>
36 </Grid>
37
38 <Grid Grid.Row="1" Margin="0,3.5,0,0">
39 <ListBox x:Name="WidgetLibraryList"
40 chronos:DragDropManager.IsDragSource="True"
41 Background="Transparent"
42 IsSynchronizedWithCurrentItem="True"
43 VerticalAlignment="Stretch"
44 ItemsSource="{Binding Source={StaticResource WidgetsViewSource}}"
45 SelectedItem="{Binding SelectedWidget, Mode=TwoWay}"
46 AllowDrop="False"
47 ScrollViewer.HorizontalScrollBarVisibility="Hidden">
48
49 <ListBox.ItemTemplate>
50 <DataTemplate DataType="{x:Type chronos:WidgetViewModel}">
51 <ContentControl Margin="3.5" HorizontalContentAlignment="Stretch" Background="Transparent">
52 <ContentControl.InputBindings>
53 <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding CreateWidgetCommand}"/>
54 </ContentControl.InputBindings>
55
56 <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center">
57 <TextBlock Text="{Binding Title}"
58 FontSize="{StaticResource ControlTitleFontSize}" FontWeight="Light"/>
59
60 <TextBlock Text="{Binding Description}"
61 TextWrapping="Wrap"/>
62 </StackPanel>
63 </ContentControl>
64 </DataTemplate>
65 </ListBox.ItemTemplate>
66 </ListBox>
67 </Grid>
68
69 <Grid Grid.Row="2">
70 <Button Content="Add to Desktop" Command="{Binding CreateWidgetCommand}" HorizontalAlignment="Right" />
71 </Grid>
72 </Grid>
73 </chronos:WidgetElement>