Statistics
| Branch: | Revision:

root / trunk / Pithos.Client.WPF / Shell / ShellView.xaml @ 6aa29f4f

History | View | Annotate | Download (7.1 kB)

1
<Window x:Class="Pithos.Client.WPF.ShellView"
2
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
        xmlns:tb="clr-namespace:Hardcodet.Wpf.TaskbarNotification;assembly=Hardcodet.Wpf.TaskbarNotification" 
5
        xmlns:cal="http://www.caliburnproject.org"
6
        x:Name="TheView" WindowStartupLocation="CenterScreen" WindowStyle="None"
7
        Width="700" Height="200" SizeToContent="Width">
8

    
9
    <Window.Background>
10
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
11
            <GradientStop Color="#4085A5" Offset="0"/>
12
            <GradientStop Color="#D7E8F0" Offset="1"/>
13
        </LinearGradientBrush>
14
    </Window.Background>    
15
    <Window.Resources>
16
        <ResourceDictionary>
17
            <ResourceDictionary.MergedDictionaries>
18
                <ResourceDictionary Source="../PithosStyles.xaml" />
19
            </ResourceDictionary.MergedDictionaries>
20
            <BooleanToVisibilityConverter x:Key="BooleanToVisible" />
21
        </ResourceDictionary>
22
    </Window.Resources>
23
    <Grid>
24
        <Grid.RowDefinitions>
25
            <RowDefinition Height="*"/>
26
            <RowDefinition Height="Auto"/>
27
        </Grid.RowDefinitions>
28

    
29
        <tb:TaskbarIcon x:Name="TaskbarView"                           
30
                        IconSource="{Binding StatusIcon}" 
31
                        ToolTipText="{Binding StatusMessage}"                        
32
                        MenuActivation="LeftOrRightClick" 
33
                        DoubleClickCommand="{Binding OpenPithosFolderCommand}"                         
34
                        >
35
            <tb:TaskbarIcon.ContextMenu>
36
                <ContextMenu x:Name="TaskbarMenu" >
37
                    <MenuItem Header="{Binding OpenFolderCaption}" IsEnabled="{Binding HasAccounts}" x:Name="OpenPithosFolder" ItemsSource="{Binding Accounts}" >
38
                        <MenuItem.ItemTemplate>
39
                            <DataTemplate>
40
                                <TextBlock x:Name="AccountLink"  Text="{Binding Path=UserName}" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action OpenPithosFolder($dataContext)]" 
41
                                           cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=2}, Path=DataContext}" />
42
                            </DataTemplate>
43
                        </MenuItem.ItemTemplate>
44
                        <MenuItem.Icon>
45
                            <Image Source="/Pithos.Client.WPF;component/Images/Folder.ico" />
46
                        </MenuItem.Icon>
47
                    </MenuItem>
48
                    <MenuItem Header="Go to Account Site" x:Name="GoToSiteMenu" ItemsSource="{Binding Accounts}" Visibility="{Binding Path=HasAccounts, Converter={StaticResource BooleanToVisible}}" >
49
                        <MenuItem.ItemTemplate>
50
                            <DataTemplate>
51
                                <TextBlock x:Name="AccountLink" Text="{Binding Path=UserName}" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite($dataContext)]" 
52
                                           cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=2}, Path=DataContext}" />
53
                            </DataTemplate>
54
                        </MenuItem.ItemTemplate>
55
                        <MenuItem.Icon>
56
                            <Image Source="/Pithos.Client.WPF;component/Images/Web.ico" />
57
                        </MenuItem.Icon>
58
                    </MenuItem>
59

    
60
                    <MenuItem Header="Recently Changed Files" x:Name="RecentFiles" ItemsSource="{Binding RecentFiles}">
61
                        <MenuItem.ItemTemplate>
62
                            <DataTemplate>
63
                                <TextBlock Text="{Binding FileName}"/>
64
                            </DataTemplate>
65
                        </MenuItem.ItemTemplate>
66
                    </MenuItem>
67
                    <Separator  />                    
68
                    <MenuItem Header="Usage" x:Name="Usages" ItemsSource="{Binding Accounts}">
69
                        <MenuItem.ItemTemplate>
70
                            <DataTemplate>
71
                                <StackPanel Orientation="Horizontal">
72
                                    <TextBlock Text="{Binding UserName}" />
73
                                    <TextBlock Text=":" Margin="5,0"/>
74
                                    <TextBlock Text="{Binding Usage}" />
75
                                </StackPanel>
76
                            </DataTemplate>
77
                        </MenuItem.ItemTemplate>
78
                    </MenuItem>
79
                    <Separator  />
80
                    <MenuItem Header="{Binding StatusMessage}" x:Name="StatusMessage" />
81
                    <Separator  />
82
                    <MenuItem  Header="{Binding PauseSyncCaption}" x:Name="ToggleSynching" cal:Message.Attach="ToggleSynching"  />
83
                    <Separator  />
84
                    <MenuItem  Header="Preferences ..." x:Name="ShowPreferences" cal:Message.Attach="ShowPreferences"  />
85
                    <Separator  />
86
                    <MenuItem  Header="Send Feedback" x:Name="SendFeedback" cal:Message.Attach="SendFeedback">
87
                        <MenuItem.Icon>
88
                            <Image Source="/Pithos.Client.WPF;component/Images/Feedback.ico" />
89
                        </MenuItem.Icon>
90
                    </MenuItem>
91
                    <MenuItem  Header="About Pithos" x:Name="AboutPithos" cal:Message.Attach="AboutPithos">
92
                        <MenuItem.Icon>
93
                            <Image Source="/Pithos.Client.WPF;component/Images/About.ico" />
94
                        </MenuItem.Icon>
95
                    </MenuItem>
96
                    <MenuItem x:Name="GoToSiteRootMenu"  cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite()]"
97
                              cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=1}, Path=DataContext}" >
98
                        <MenuItem.HeaderTemplate>
99
                            <DataTemplate>
100
                                <TextBlock x:Name="SiteLink" Text="Go To Pithos Site" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite()]" 
101
                                           cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=1}, Path=DataContext}" />
102
                            </DataTemplate>
103
                        </MenuItem.HeaderTemplate>
104
                        <MenuItem.Icon>
105
                            <Image Source="/Pithos.Client.WPF;component/Images/Web.ico" />
106
                        </MenuItem.Icon>
107
                    </MenuItem>
108
                    <Separator  />
109
                    <MenuItem  Header="Exit" Name="ExitPithos" cal:Message.Attach="ExitPithos" />
110
                </ContextMenu>
111
            </tb:TaskbarIcon.ContextMenu>
112
        </tb:TaskbarIcon>
113
        <Image Margin="0,0,10,5" Source="/Pithos.Client.WPF;component/Images/logo.png" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="None"/>
114
    </Grid>
115
</Window>