New Message, Feedback, About views
authorPanagiotis Kanavos <pkanavos@gmail.com>
Thu, 10 Nov 2011 16:56:16 +0000 (18:56 +0200)
committerPanagiotis Kanavos <pkanavos@gmail.com>
Thu, 10 Nov 2011 16:56:16 +0000 (18:56 +0200)
15 files changed:
trunk/Pithos.Client.WPF/Shell/AboutView.xaml [new file with mode: 0644]
trunk/Pithos.Client.WPF/Shell/AboutView.xaml.cs [new file with mode: 0644]
trunk/Pithos.Client.WPF/Shell/AboutViewModel.cs [new file with mode: 0644]
trunk/Pithos.Client.WPF/Shell/FeedbackView.xaml [new file with mode: 0644]
trunk/Pithos.Client.WPF/Shell/FeedbackView.xaml.cs [new file with mode: 0644]
trunk/Pithos.Client.WPF/Shell/FeedbackViewModel.cs [new file with mode: 0644]
trunk/Pithos.Client.WPF/Shell/IShell.cs [new file with mode: 0644]
trunk/Pithos.Client.WPF/Shell/MessageView.xaml [new file with mode: 0644]
trunk/Pithos.Client.WPF/Shell/MessageView.xaml.cs [new file with mode: 0644]
trunk/Pithos.Client.WPF/Shell/Notification.cs [new file with mode: 0644]
trunk/Pithos.Client.WPF/Shell/ShellView.xaml [new file with mode: 0644]
trunk/packages/Extended.Wpf.Toolkit.1.5.0/Extended.Wpf.Toolkit.1.5.0.nupkg [new file with mode: 0644]
trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net35/WPFToolkit.Extended.dll [new file with mode: 0644]
trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net35/WPFToolkit.dll [new file with mode: 0644]
trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net40/WPFToolkit.Extended.dll [new file with mode: 0644]

diff --git a/trunk/Pithos.Client.WPF/Shell/AboutView.xaml b/trunk/Pithos.Client.WPF/Shell/AboutView.xaml
new file mode 100644 (file)
index 0000000..e30cdbe
--- /dev/null
@@ -0,0 +1,20 @@
+<Window x:Class="Pithos.Client.WPF.AboutView"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        Title="AboutView" Height="300" Width="300">
+    <StackPanel>
+        <TextBlock Text="Pithos Windows Client" HorizontalAlignment="Center" FontSize="14" FontWeight="Bold"/>
+        <StackPanel Orientation="Horizontal">
+            <TextBlock Text="Version"/>
+            <TextBlock x:Name="Version" FontWeight="Bold" Margin="5" />
+        </StackPanel>
+        <StackPanel Orientation="Horizontal">
+            <TextBlock Text="Released"/>
+            <TextBlock x:Name="ReleaseDate" FontWeight="Bold" Margin="5"/>
+        </StackPanel>
+        <TextBlock>
+            <Hyperlink NavigateUri="" >Support Page</Hyperlink>
+        </TextBlock>
+        
+    </StackPanel>
+</Window>
diff --git a/trunk/Pithos.Client.WPF/Shell/AboutView.xaml.cs b/trunk/Pithos.Client.WPF/Shell/AboutView.xaml.cs
new file mode 100644 (file)
index 0000000..07a8f43
--- /dev/null
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace Pithos.Client.WPF
+{
+    /// <summary>
+    /// Interaction logic for AboutView.xaml
+    /// </summary>
+    public partial class AboutView : Window
+    {
+        public AboutView()
+        {
+            InitializeComponent();
+        }
+    }
+}
diff --git a/trunk/Pithos.Client.WPF/Shell/AboutViewModel.cs b/trunk/Pithos.Client.WPF/Shell/AboutViewModel.cs
new file mode 100644 (file)
index 0000000..997daf0
--- /dev/null
@@ -0,0 +1,51 @@
+// -----------------------------------------------------------------------
+// <copyright file="AboutViewModel.cs" company="Microsoft">
+// TODO: Update copyright text.
+// </copyright>
+// -----------------------------------------------------------------------
+
+using System.ComponentModel.Composition;
+using Caliburn.Micro;
+
+namespace Pithos.Client.WPF.Shell
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using System.Text;
+
+    /// <summary>
+    /// TODO: Update summary.
+    /// </summary>
+    [Export(typeof(AboutViewModel))]
+    public class AboutViewModel:Screen
+    {
+        private string _version;
+        public string Version { get; set; }
+/*
+        {
+            get { return _version; }
+            set
+            {
+                _version = value;
+                NotifyOfPropertyChange(()=>Version);
+            }
+        }
+*/
+
+        private DateTime _released;
+        public DateTime Released { get; set; }
+/*
+        {
+            get { return _released; }
+            set
+            {
+                _released = value;
+                NotifyOfPropertyChange(()=>Released);
+            }
+        }
+*/
+
+        public Uri SupportPage { get; set; }
+    }
+}
diff --git a/trunk/Pithos.Client.WPF/Shell/FeedbackView.xaml b/trunk/Pithos.Client.WPF/Shell/FeedbackView.xaml
new file mode 100644 (file)
index 0000000..941f733
--- /dev/null
@@ -0,0 +1,8 @@
+<Window x:Class="Pithos.Client.WPF.Shell.FeedbackView"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        Title="FeedbackView" Height="300" Width="300">
+    <Grid>
+        
+    </Grid>
+</Window>
diff --git a/trunk/Pithos.Client.WPF/Shell/FeedbackView.xaml.cs b/trunk/Pithos.Client.WPF/Shell/FeedbackView.xaml.cs
new file mode 100644 (file)
index 0000000..0da8003
--- /dev/null
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace Pithos.Client.WPF.Shell
+{
+    /// <summary>
+    /// Interaction logic for FeedbackView.xaml
+    /// </summary>
+    public partial class FeedbackView : Window
+    {
+        public FeedbackView()
+        {
+            InitializeComponent();
+        }
+    }
+}
diff --git a/trunk/Pithos.Client.WPF/Shell/FeedbackViewModel.cs b/trunk/Pithos.Client.WPF/Shell/FeedbackViewModel.cs
new file mode 100644 (file)
index 0000000..ed8379c
--- /dev/null
@@ -0,0 +1,36 @@
+// -----------------------------------------------------------------------
+// <copyright file="FeedbackViewModel.cs" company="Microsoft">
+// TODO: Update copyright text.
+// </copyright>
+// -----------------------------------------------------------------------
+
+using System.ComponentModel.Composition;
+using Caliburn.Micro;
+
+namespace Pithos.Client.WPF.Shell
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using System.Text;
+
+    /// <summary>
+    /// TODO: Update summary.
+    /// </summary>
+    [Export(typeof(FeedbackViewModel))]
+    public class FeedbackViewModel:Screen
+    {
+
+        public string Message { get; set; }
+
+        public string Data { get; set; }
+
+
+        public bool CanSend{get { return (!String.IsNullOrWhiteSpace(Message)); }}
+
+        public void Send()
+        {
+            
+        }
+    }
+}
diff --git a/trunk/Pithos.Client.WPF/Shell/IShell.cs b/trunk/Pithos.Client.WPF/Shell/IShell.cs
new file mode 100644 (file)
index 0000000..8290828
--- /dev/null
@@ -0,0 +1,3 @@
+namespace Pithos.Client.WPF {
+    public interface IShell {}
+}
diff --git a/trunk/Pithos.Client.WPF/Shell/MessageView.xaml b/trunk/Pithos.Client.WPF/Shell/MessageView.xaml
new file mode 100644 (file)
index 0000000..954712e
--- /dev/null
@@ -0,0 +1,41 @@
+<Window x:Class="Pithos.Client.WPF.MessageView"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        Title="MessageView" Height="300" Width="500" Background="{StaticResource {x:Static SystemColors.ControlBrushKey}}" WindowStartupLocation="CenterScreen">
+    <Window.CommandBindings>
+        <CommandBinding Command="ApplicationCommands.Close"
+                    Executed="OnClose"/>
+        <CommandBinding Command="ApplicationCommands.Copy"
+                    Executed="OnCopy"/>
+    </Window.CommandBindings>
+    <Window.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../PithosStyles.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </Window.Resources>
+
+    <Grid x:Name="LayoutRoot" Margin="5">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition Height="*"/>
+            <RowDefinition Height="Auto" />
+        </Grid.RowDefinitions>
+        <TextBlock Text="{Binding Message,FallbackValue='Error Message'}" Grid.Row="0" TextWrapping="WrapWithOverflow" Margin="0,5,0,10"/>
+        <ListBox  ItemsSource="{Binding Path=UserMessages}" Grid.Row="1">
+            <ListBox.ItemTemplate>
+                <DataTemplate>
+                    <Expander Header="{Binding Message,FallbackValue='Seems we have a problem'}" FontWeight="Bold">
+                        <TextBlock Text="{Binding Details,FallbackValue='This is a message'}" FontWeight="Normal" TextWrapping="Wrap" />
+                    </Expander>
+                </DataTemplate>
+            </ListBox.ItemTemplate>
+        </ListBox>
+        <Grid Grid.Row="2" Margin="5,10">            
+            <Button x:Name="Copy" Content="Copy" ToolTip="Copy to Clipboard" HorizontalAlignment="Left" Style="{StaticResource MediumButton}" Command="Copy"/>
+            
+            <Button x:Name="OKButton" Content="Close" HorizontalAlignment="Right" Grid.Row="2" IsDefault="True" Style="{StaticResource MediumButton}" Command="Close"  />
+        </Grid>
+    </Grid>
+</Window>
diff --git a/trunk/Pithos.Client.WPF/Shell/MessageView.xaml.cs b/trunk/Pithos.Client.WPF/Shell/MessageView.xaml.cs
new file mode 100644 (file)
index 0000000..eae39a6
--- /dev/null
@@ -0,0 +1,108 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.ComponentModel.Composition;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Net.Mail;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using Caliburn.Micro;
+
+namespace Pithos.Client.WPF
+{
+    /// <summary>
+    /// Interaction logic for MessageView.xaml
+    /// </summary>
+    public partial class MessageView : Window, INotifyPropertyChanged
+    {
+        public ObservableCollection<UserMessage> UserMessages { get; set; }
+
+        private string _message;
+        public string Message
+        {
+            get
+            {
+                return _message;
+            }
+            set
+            {
+                _message = value;
+                NotifyOfPropertyChange(()=>Message);
+            }
+        }
+
+
+        public MessageView(IEnumerable<UserMessage> userMessages)
+        {
+            UserMessages = new ObservableCollection<UserMessage>(userMessages);
+            DataContext = this;
+            InitializeComponent();            
+        }
+
+        /// <summary>
+        /// Copies the messages to the clipboard
+        /// </summary>
+        private void OnCopy(object sender, ExecutedRoutedEventArgs e)
+        {
+            StringBuilder clipText = new StringBuilder()
+                .Append('-', 30)
+                .AppendLine("\r\nProduct Map")
+                .Append('-', 30)
+                .AppendLine()
+                .AppendLine();
+            foreach (var message in UserMessages)
+            {
+                clipText
+                    .Append('-', 20)
+                    .AppendFormat("\r\n[{0,5}]\t{1}", message.Severity, message.Message)
+                    .AppendLine()
+                    .AppendLine(message.Details)
+                    .AppendLine();
+            }
+
+            Clipboard.SetText(clipText.ToString());
+        }
+
+        private void OnClose(object sender, ExecutedRoutedEventArgs e)
+        {
+            this.Close();
+        }
+
+        public event PropertyChangedEventHandler PropertyChanged;
+
+        private void NotifyOfPropertyChange<TProperty>(Expression<Func<TProperty>> property)
+        {
+            if (PropertyChanged!=null)
+                PropertyChanged(this,new PropertyChangedEventArgs(property.GetMemberInfo().Name));
+        }
+
+        private void OnSend(object sender, RoutedEventArgs e)
+        {
+            SmtpClient client=new SmtpClient();
+        }
+    }
+
+    public class UserMessage
+    {
+        public string Message { get; set; }
+
+        public Severity Severity { get; set; }
+        public string Details { get; set; }
+    }
+
+    public enum Severity
+    {
+        Info,
+        Warn,
+        Error
+    }
+}
diff --git a/trunk/Pithos.Client.WPF/Shell/Notification.cs b/trunk/Pithos.Client.WPF/Shell/Notification.cs
new file mode 100644 (file)
index 0000000..a6a7420
--- /dev/null
@@ -0,0 +1,12 @@
+using System.Diagnostics;
+
+namespace Pithos.Client.WPF
+{
+    public class Notification
+    {
+        public string Title { get; set; }
+        public string Message { get; set; }
+        public TraceLevel Level { get; set; }
+    }
+    
+}
\ No newline at end of file
diff --git a/trunk/Pithos.Client.WPF/Shell/ShellView.xaml b/trunk/Pithos.Client.WPF/Shell/ShellView.xaml
new file mode 100644 (file)
index 0000000..ad5a7a8
--- /dev/null
@@ -0,0 +1,81 @@
+<Window x:Class="Pithos.Client.WPF.ShellView"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:tb="clr-namespace:Hardcodet.Wpf.TaskbarNotification;assembly=Hardcodet.Wpf.TaskbarNotification" 
+        xmlns:cal="http://www.caliburnproject.org"
+        x:Name="TheView"
+         >
+
+    <Window.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../PithosStyles.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </Window.Resources>
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="*"/>
+            <RowDefinition Height="Auto"/>
+        </Grid.RowDefinitions>
+
+        <tb:TaskbarIcon x:Name="TaskbarView"                           
+                        IconSource="{Binding StatusIcon}" 
+                        ToolTipText="{Binding StatusMessage}"                        
+                        MenuActivation="LeftOrRightClick" 
+                        DoubleClickCommand="{Binding OpenPithosFolderCommand}"                         
+                        >
+            <tb:TaskbarIcon.ContextMenu>
+                <ContextMenu x:Name="TaskbarMenu" >
+                    <MenuItem Header="Open PITHOS Folder" x:Name="OpenPithosFolder" ItemsSource="{Binding Accounts}" >
+                        <MenuItem.ItemTemplate>
+                            <DataTemplate>
+                                <TextBlock x:Name="AccountLink" Text="{Binding Path=UserName}" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action OpenPithosFolder($dataContext)]" 
+                                           cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=2}, Path=DataContext}" />
+                            </DataTemplate>
+                        </MenuItem.ItemTemplate>                        
+                        </MenuItem> 
+                    <MenuItem Header="Go to Account Site" x:Name="GoToSiteMenu" ItemsSource="{Binding Accounts}" >
+                        <MenuItem.ItemTemplate>
+                            <DataTemplate>
+                                <TextBlock x:Name="AccountLink" Text="{Binding Path=UserName}" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite($dataContext)]" 
+                                           cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=2}, Path=DataContext}" />
+                            </DataTemplate>
+                        </MenuItem.ItemTemplate>
+                    </MenuItem>
+
+                    <MenuItem Header="Recently Changed Files" x:Name="RecentFiles" ItemsSource="{Binding RecentFiles}">
+                        <MenuItem.ItemTemplate>
+                            <DataTemplate>
+                                <TextBlock Text="{Binding FileName}"/>
+                            </DataTemplate>
+                        </MenuItem.ItemTemplate>
+                    </MenuItem>
+                    <Separator  />                    
+                    <MenuItem Header="Usage" x:Name="Usages" ItemsSource="{Binding Accounts}">
+                        <MenuItem.ItemTemplate>
+                            <DataTemplate>
+                                <StackPanel Orientation="Horizontal">
+                                    <TextBlock Text="{Binding UserName}" />
+                                    <TextBlock Text=":" Margin="5,0"/>
+                                    <TextBlock Text="{Binding Usage}" />
+                                </StackPanel>
+                            </DataTemplate>
+                        </MenuItem.ItemTemplate>
+                    </MenuItem>
+                    <Separator  />
+                    <MenuItem Header="{Binding StatusMessage}" x:Name="StatusMessage" />
+                    <Separator  />
+                    <MenuItem  Header="{Binding PauseSyncCaption}" x:Name="ToggleSynching" cal:Message.Attach="ToggleSynching"  />
+                    <Separator  />
+                    <MenuItem  Header="Preferences ..." x:Name="ShowPreferences" cal:Message.Attach="ShowPreferences"  />
+                    <Separator  />
+                    <MenuItem  Header="Send Feedback " x:Name="SendFeedback" cal:Message.Attach="SendFeedback"  />
+                    <MenuItem  Header="About Pithos" x:Name="AboutPithos" cal:Message.Attach="About Pithos"  />
+                    <Separator  />
+                    <MenuItem  Header="Exit" Name="ExitPithos" cal:Message.Attach="ExitPithos" />
+                </ContextMenu>
+            </tb:TaskbarIcon.ContextMenu>
+        </tb:TaskbarIcon>
+    </Grid>
+</Window>
diff --git a/trunk/packages/Extended.Wpf.Toolkit.1.5.0/Extended.Wpf.Toolkit.1.5.0.nupkg b/trunk/packages/Extended.Wpf.Toolkit.1.5.0/Extended.Wpf.Toolkit.1.5.0.nupkg
new file mode 100644 (file)
index 0000000..5fc8ce1
Binary files /dev/null and b/trunk/packages/Extended.Wpf.Toolkit.1.5.0/Extended.Wpf.Toolkit.1.5.0.nupkg differ
diff --git a/trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net35/WPFToolkit.Extended.dll b/trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net35/WPFToolkit.Extended.dll
new file mode 100644 (file)
index 0000000..1d6873b
Binary files /dev/null and b/trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net35/WPFToolkit.Extended.dll differ
diff --git a/trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net35/WPFToolkit.dll b/trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net35/WPFToolkit.dll
new file mode 100644 (file)
index 0000000..89b123c
Binary files /dev/null and b/trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net35/WPFToolkit.dll differ
diff --git a/trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net40/WPFToolkit.Extended.dll b/trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net40/WPFToolkit.Extended.dll
new file mode 100644 (file)
index 0000000..b0fcd8b
Binary files /dev/null and b/trunk/packages/Extended.Wpf.Toolkit.1.5.0/lib/net40/WPFToolkit.Extended.dll differ