Statistics
| Branch: | Revision:

root / trunk / Pithos.Client.WPF / Shell / ShellView.xaml @ 79f92570

History | View | Annotate | Download (8.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
        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  x:Name="StatusMessage">
86
                        <MenuItem.Header>
87
                            <TextBlock Text="{Binding StatusMessage}" TextWrapping="WrapWithOverflow" Width="160" />
88
                        </MenuItem.Header>
89
                    </MenuItem>
90
                    <Separator  />
91
                    <MenuItem  Header="{Binding PauseSyncCaption}" x:Name="ToggleSynching" cal:Message.Attach="ToggleSynching"  />
92
                    <Separator  />
93
                    <MenuItem  Header="Preferences ..." x:Name="ShowPreferences" cal:Message.Attach="ShowPreferences"  />
94
                    <Separator  />
95
                    <MenuItem  Header="Send Feedback" x:Name="SendFeedback" cal:Message.Attach="SendFeedback">
96
                        <MenuItem.Icon>
97
                            <Image Source="/Pithos.Client.WPF;component/Images/Feedback.ico" />
98
                        </MenuItem.Icon>
99
                    </MenuItem>
100
                    <MenuItem  Header="About Pithos" x:Name="AboutPithos" cal:Message.Attach="AboutPithos">
101
                        <MenuItem.Icon>
102
                            <Image Source="/Pithos.Client.WPF;component/Images/About.ico" />
103
                        </MenuItem.Icon>
104
                    </MenuItem>
105
                    <MenuItem x:Name="GoToSiteRootMenu"  cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite()]"
106
                              cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=1}, Path=DataContext}" >
107
                        <MenuItem.HeaderTemplate>
108
                            <DataTemplate>
109
                                <TextBlock x:Name="SiteLink" Text="Go To Pithos Site" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite()]" 
110
                                           cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=1}, Path=DataContext}" />
111
                            </DataTemplate>
112
                        </MenuItem.HeaderTemplate>
113
                        <MenuItem.Icon>
114
                            <Image Source="/Pithos.Client.WPF;component/Images/Web.ico" />
115
                        </MenuItem.Icon>
116
                    </MenuItem>
117
                    <Separator  />
118
                    <MenuItem  Header="Exit" Name="ExitPithos" cal:Message.Attach="ExitPithos" />
119
                </ContextMenu>
120
            </tb:TaskbarIcon.ContextMenu>
121
            <tb:TaskbarIcon.TrayToolTip>
122
                <Border Background="White" 
123
                        BorderBrush="Black" 
124
                        BorderThickness="1" 
125
                        CornerRadius="2">
126
                    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding StatusMessage}" Margin="5"></TextBlock>
127
                </Border>
128
            </tb:TaskbarIcon.TrayToolTip>
129
        </tb:TaskbarIcon>
130
<!--
131
        <Image Margin="0,0,10,5" Source="/Pithos.Client.WPF;component/Images/logo.png" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="None"/>
132
-->
133
    </Grid>
134
</Window>