Statistics
| Branch: | Revision:

root / trunk / Pithos.Client.WPF / Shell / ShellView.xaml @ 7f5882da

History | View | Annotate | Download (8.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
        Visibility="Collapsed"
8
        Width="700" Height="200" SizeToContent="Width" WindowState="Minimized" Icon="/Pithos.Client.WPF;component/Images/PithosTaskbar.png">
9

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

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

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