Statistics
| Branch: | Revision:

root / trunk / Pithos.Client.WPF / Shell / ShellView.xaml @ 29a6b387

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