Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

GoalBook - A Hybrid Smart Client

, 25 Sep 2009 CPOL
A WPF hybrid smart client that synchronises your goals with the Toodledo online To-do service.
GoalBook.zip
GoalBook
Dependencies
CAG WPF 2
Microsoft.Practices.Composite.dll
Microsoft.Practices.Composite.Presentation.dll
Microsoft.Practices.Composite.UnityExtensions.dll
Microsoft.Practices.ObjectBuilder2.dll
Microsoft.Practices.ServiceLocation.dll
Microsoft.Practices.Unity.dll
vssver2.scc
CSLA
Csla.dll
Csla.XmlSerializers.dll
vssver2.scc
Infragistics
Infragistics3.Wpf.DataPresenter.v9.1.Express.dll
Infragistics3.Wpf.Editors.v9.1.Express.dll
Infragistics3.Wpf.v9.1.Express.dll
vssver2.scc
WPFToolkit
vssver2.scc
WPFToolkit.dll
GoalBook.Controls
CheckedList
vssver2.scc
Properties
vssver2.scc
vssver2.scc
GoalBook.Goals
GoalBook.Goals.csproj.user
Properties
vssver2.scc
Views
vssver2.scc
vssver2.scc
GoalBook.Infrastructure
Comparers
vssver2.scc
Constants
vssver2.scc
Controls
Converters
vssver2.scc
Enums
vssver2.scc
Events
vssver2.scc
GoalBook.Infrastructure.csproj.user
Helpers
vssver2.scc
Interfaces
vssver2.scc
ObjectModel
vssver2.scc
Printing
vssver2.scc
Properties
vssver2.scc
vssver2.scc
GoalBook.Notes
GoalBook.Notes.csproj.user
Properties
vssver2.scc
Resources
arrow_redo.png
arrow_undo.png
cut.png
page_copy.png
paste_plain.png
text_bold.png
text_indent.png
text_indent_remove.png
text_italic.png
text_list_bullets.png
text_list_numbers.png
vssver2.scc
world_link.png
Views
vssver2.scc
vssver2.scc
GoalBook.Public
Encryption
vssver2.scc
HtmlConverter
vssver2.scc
HtmlParser
vssver2.scc
Misc
vssver2.scc
Properties
vssver2.scc
vssver2.scc
GoalBook.Shell
App.ico
Commands
vssver2.scc
GoalBook.Shell.csproj.user
Journal.ico
Journal48.ico
Misc
vssver2.scc
Modules
vssver2.scc
Properties
licenses.licx
vssver2.scc
Resources
arrow_refresh.png
arrow_undo.png
checked.gif
cross.png
disk.png
email.png
erase.png
error.png
exclamation.png
flag_red.png
group.png
help.png
information.png
magnifier.png
page_red.png
pencil.png
printer.png
user.png
vssver2.scc
Wave.jpg
world.png
world_link.png
Services
vssver2.scc
Splash.png
Views
vssver2.scc
vssver2.scc
Windows
vssver2.scc
GoalBook.snk
GoalBook.Synchronisation
Events
vssver2.scc
Properties
vssver2.scc
ToodleDo
vssver2.scc
vssver2.scc
GoalBook.Tasks
Controls
vssver2.scc
Properties
vssver2.scc
Views
vssver2.scc
vssver2.scc
vssver2.scc
<Window x:Class="GoalBook.Shell.Windows.Main"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:CAL="http://www.codeplex.com/CompositeWPF" 
    xmlns:ShellServices="clr-namespace:GoalBook.Shell.Services"
    xmlns:ShellProperties="clr-namespace:GoalBook.Shell.Properties"    
    Background="{DynamicResource WindowBackground}"
    Icon="/GoalBook.Shell;component/App.ico"    
    Title="{x:Static ShellServices:AssemblyInfoProperties.ProductName}"
    ResizeMode="CanResizeWithGrip"    
    MinWidth="600" 
    MinHeight="400"
    KeyUp="Window_KeyUp"
    Closing="Window_Closing" ShowActivated="True">
	<DockPanel Name="dockPanelMain" LastChildFill="True">
		<StatusBar Height="27" Name="statusBarMain" Margin="0,0,0,0" VerticalAlignment="Center" DockPanel.Dock="Bottom" Background="Transparent">
			<StatusBarItem Name="statusBarItemMessage" HorizontalAlignment="Stretch" BorderThickness="0" Padding="5,3,3,3" VerticalContentAlignment="Center" />
			<StatusBarItem Name="statusBarItemSyncImage" HorizontalAlignment="Right" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="50" Padding="1">
				<Image Name="statusBarSyncImage" ToolTip="{x:Static ShellProperties:Resources.SyncImageToolTipText}" Width="16" Height="16" />
			</StatusBarItem>
		</StatusBar>
		<Grid Margin="0" Height="Auto" Width="Auto" ShowGridLines="False">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*"></ColumnDefinition>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="30"></RowDefinition>
				<RowDefinition Height="*"></RowDefinition>
			</Grid.RowDefinitions>
			<Grid.Resources>
				<!--Background gradient for mainmenu and module views title-->
				<Style x:Key="backgroundGradientStyle">
					<Setter Property="Control.Background">
						<Setter.Value>
							<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
								<GradientStop Color="#FFF8F8FF" Offset="0" />
								<GradientStop Color="#FFD3D3D3" Offset="0.40625" />
								<GradientStop Color="#FFC0C0C0" Offset="0.40625" />
								<GradientStop Color="#FFD3D3D3" Offset="1" />
							</LinearGradientBrush>
						</Setter.Value>
					</Setter>
				</Style>				
			</Grid.Resources>
			<Grid Margin="0" Height="Auto" Width="Auto" ShowGridLines="False">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*"></ColumnDefinition>
					<ColumnDefinition Width="20"></ColumnDefinition>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="29"></RowDefinition>					
				</Grid.RowDefinitions>
				<ToolBar ToolBarTray.IsLocked="True" 
					Grid.Row="0" 
					Grid.Column="0" 
					Grid.ColumnSpan="2"					
					Loaded="ToolBar_Loaded"
					Style="{StaticResource backgroundGradientStyle}"
					Padding="3,1,0,0" 
					Margin="-3,-1,-13,0">					
					<Menu Name="mainMenu" Background="Transparent" ToolBar.OverflowMode="Never">
						<!-- Module Menu -->
						<MenuItem Header="{x:Static ShellProperties:Resources.MenuModuleText}" Name="menuModule" IsTabStop="False">
						<!-- New Menu -->
						<MenuItem Header="{x:Static ShellProperties:Resources.MenuNewText}" Name="menuNew" IsTabStop="False"/>
						<Separator Margin="0"/>
						<MenuItem Name="menuItemSave"
							Header="{Binding SaveCommandInfo.Title}"						
							InputGestureText="{Binding SaveCommandInfo.KeyInputGesture.DisplayString}"						
							Command="{Binding SaveCommand}"
							CommandParameter="{Binding SaveCommandInfo}">
							<MenuItem.Icon>
								<Image Height="16" Width="16" Source="{Binding SaveCommandInfo.IconUri}" />
							</MenuItem.Icon>
						</MenuItem>	
						<Separator Margin="0" />
						<MenuItem Name="menuItemPrint"
							Header="{Binding PrintCommandInfo.Title}"						
							InputGestureText="{Binding PrintCommandInfo.KeyInputGesture.DisplayString}"						
							Command="{Binding PrintCommand}"
							CommandParameter="{Binding PrintCommandInfo}">
							<MenuItem.Icon>
								<Image Height="16" Width="16" Source="{Binding PrintCommandInfo.IconUri}" />
							</MenuItem.Icon>
						</MenuItem>
						<Separator Margin="0" />
						<MenuItem Header="{Binding ExitCommandInfo.Title}"
							Name="menuItemExit"
							InputGestureText="{Binding ExitCommandInfo.KeyInputGesture.DisplayString}"
							Command="{Binding ExitCommand}"
							CommandParameter="{Binding ExitCommandInfo}">
						</MenuItem>
					</MenuItem>
					<!-- Edit Menu -->
					<MenuItem Header="{x:Static ShellProperties:Resources.MenuEditText}" IsTabStop="False">
						<MenuItem Name="menuItemUndo"
							Header="{Binding UndoCommandInfo.Title}"
							InputGestureText="{Binding UndoCommandInfo.KeyInputGesture.DisplayString}"
							Command="{Binding UndoCommand}"
							CommandParameter="{Binding UndoCommandInfo}">
							<MenuItem.Icon>
								<Image Height="16" Width="16" Source="{Binding UndoCommandInfo.IconUri}" />
							</MenuItem.Icon>
						</MenuItem>
						<Separator Margin="0"/>
						<MenuItem Name="menuItemDelete"
							Header="{Binding DeleteCommandInfo.Title}"
							InputGestureText="{Binding DeleteCommandInfo.KeyInputGesture.DisplayString}"
							Command="{Binding DeleteCommand}"
							CommandParameter="{Binding DeleteCommandInfo}">
							<MenuItem.Icon>
								<Image Height="16" Width="16" Source="{Binding DeleteCommandInfo.IconUri}" />
							</MenuItem.Icon>
						</MenuItem>
					</MenuItem>
					<!-- Go Menu (1 item added for each module) - Hidden until item count > 1 -->
					<MenuItem Header="{x:Static ShellProperties:Resources.MenuGoText}" Name="menuGo" Visibility="Collapsed" IsTabStop="False"/>
					<!-- Tools Menu -->
					<MenuItem Header="{x:Static ShellProperties:Resources.MenuToolsText}" Name="menuTools" IsTabStop="False">
						<MenuItem Name="menuItemSync"
							Header="{Binding SyncCommandInfo.Title}"
							InputGestureText="{Binding SyncCommandInfo.KeyInputGesture.DisplayString}"
							Command="{Binding SyncCommand}"
							CommandParameter="{Binding SyncCommandInfo}">
							<MenuItem.Icon>
								<Image Height="16" Width="16" Source="{Binding SyncCommandInfo.IconUri}" />
							</MenuItem.Icon>
						</MenuItem>
						<Separator Margin="0"/>
						<MenuItem Name="menuItemAccount" Header="{x:Static ShellProperties:Resources.MenuAccountText}">
							<MenuItem Name="menuItemConfigureAccount"
								Header="{Binding ConfigureAccountCommandInfo.Title}"
								InputGestureText="{Binding ConfigureAccountCommandInfo.KeyInputGesture.DisplayString}"
								Command="{Binding ConfigureAccountCommand}"
								CommandParameter="{Binding ConfigureAccountCommandInfo}">
								<MenuItem.Icon>
									<Image Height="16" Width="16" Source="{Binding ConfigureAccountCommandInfo.IconUri}" />
								</MenuItem.Icon>
							</MenuItem>
							<MenuItem Name="menuItemChangeAccount"
								Header="{Binding ChangeAccountCommandInfo.Title}"
								InputGestureText="{Binding ChangeAccountCommandInfo.KeyInputGesture.DisplayString}"
								Command="{Binding ChangeAccountCommand}"
								CommandParameter="{Binding ChangeAccountCommandInfo}">
								<MenuItem.Icon>
									<Image Height="16" Width="16" Source="{Binding ChangeAccountCommandInfo.IconUri}" />
								</MenuItem.Icon>
							</MenuItem>
							<Separator Margin="0" />
							<MenuItem Name="menuItemClearData"
								Header="{Binding ClearDataCommandInfo.Title}"
								InputGestureText="{Binding ClearDataCommandInfo.KeyInputGesture.DisplayString}"
								Command="{Binding ClearDataCommand}"
								CommandParameter="{Binding ClearDataCommandInfo}">
							</MenuItem>
						</MenuItem>
						<Separator Margin="0"/>
						<MenuItem Name="menuItemInternet"
							Header="{Binding InternetCommandInfo.Title}"
							InputGestureText="{Binding InternetCommandInfo.KeyInputGesture.DisplayString}"
							Command="{Binding InternetCommand}"
							CommandParameter="{Binding InternetCommandInfo}">
							<MenuItem.Icon>
								<Image Height="16" Width="16" Source="{Binding InternetCommandInfo.IconUri}" />
							</MenuItem.Icon>
						</MenuItem>
					</MenuItem>
					<!-- Help Menu -->				
					<MenuItem Header="{x:Static ShellProperties:Resources.MenuHelpText}" IsTabStop="False">
						<MenuItem Name="menuItemFeedback"
							Header="{Binding FeedbackCommandInfo.Title}"
							InputGestureText="{Binding FeedbackCommandInfo.KeyInputGesture.DisplayString}"
							Command="{Binding FeedbackCommand}"
							CommandParameter="{Binding FeedbackCommandInfo}">
							<MenuItem.Icon>
								<Image Height="16" Width="16" Source="{Binding FeedbackCommandInfo.IconUri}" />
							</MenuItem.Icon>
						</MenuItem>
						<Separator Margin="0"/>
						<MenuItem Name="menuItemAbout"
							Header="{Binding AboutCommandInfo.Title}"
							InputGestureText="{Binding AboutCommandInfo.KeyInputGesture.DisplayString}"
							Command="{Binding AboutCommand}"
							CommandParameter="{Binding AboutCommandInfo}">
						</MenuItem>
					</MenuItem>
				</Menu>					
			</ToolBar>
			<Image Name="viewImage2" Height="16" Width="16" Grid.Column="1" Margin="0,5,5,5"/>				
			</Grid>
			<DockPanel Height="Auto" Name="dockPanelContainer" Margin="5,4,5,0" ClipToBounds="True" Width="Auto" Grid.Row="1" Grid.Column="0" DockPanel.Dock="Left">
				<Grid Margin="0" Height="Auto" Width="Auto" ShowGridLines="False">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="4*"></ColumnDefinition>
						<ColumnDefinition Width="5"></ColumnDefinition>
						<ColumnDefinition Width="200" Name="actionPaneColumn"></ColumnDefinition>						
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>												
						<RowDefinition Height="*"></RowDefinition>
					</Grid.RowDefinitions>
					<Border Margin="0,0,0,0" Grid.Row="1" Grid.ColumnSpan="1" CornerRadius="2,2,2,2" BorderBrush="{x:Static Brushes.SlateGray}" BorderThickness="1"
						Width="Auto" Height="Auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="titleBorderControl">
						<Grid DockPanel.Dock="Top" MinHeight="28" SnapsToDevicePixels="True">
							<Grid.ColumnDefinitions>							
								<ColumnDefinition Width="*"></ColumnDefinition>
								<ColumnDefinition Width="20"></ColumnDefinition>
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="27"></RowDefinition>								
								<RowDefinition Height="*"></RowDefinition>
							</Grid.RowDefinitions>
							<TextBlock FontFamily="Tahoma" Foreground="Black" VerticalAlignment="Center" Name="viewTitle" Margin="5,0" FontSize="14" FontWeight="Bold"/>
							<Image Name="viewImage" Height="16" Width="16" Grid.Column="2" Margin="0,5,5,5"/>
							<Line Stroke="SlateGray" VerticalAlignment="Bottom" X2="1" Stretch="Fill" Grid.ColumnSpan="2"/>	
							<!--Container for Module View-->
							<ItemsControl CAL:RegionManager.RegionName="MainRegion" Padding="1" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" 
								HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Background="Transparent" IsTabStop="False">
								<ItemsControl.ItemsPanel>
									<ItemsPanelTemplate>
										<DockPanel/>
									</ItemsPanelTemplate>
								</ItemsControl.ItemsPanel>
							</ItemsControl>					
						</Grid>
					</Border>					
					<GridSplitter Grid.Column="1" Grid.Row="2" Width="5" VerticalAlignment="Stretch" HorizontalAlignment="Center" Background="Transparent" IsEnabled="False"></GridSplitter>
					<Border Margin="0,0,0,0" Grid.Column="2" Grid.Row="2" CornerRadius="2,2,2,2" BorderBrush="{x:Static Brushes.SlateGray}" BorderThickness="1"
						Width="Auto" Height="Auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="taskBorderControl">						
						<Grid DockPanel.Dock="Top" MinHeight="28" SnapsToDevicePixels="True">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"></ColumnDefinition>																
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="27"></RowDefinition>
								<RowDefinition Height="*"></RowDefinition>								
							</Grid.RowDefinitions>
							<Expander Name="actionPaneExpander" 
								ExpandDirection="Left" 
								IsExpanded="True" 
								Padding="2" 
								Grid.Row="0"
								ToolTip="{x:Static ShellProperties:Resources.HideExpanderToolTip}" 
								Collapsed="Expander_Changed" 
								Expanded="Expander_Changed">
								<TextBlock Name="actionTitle" 
									FontFamily="Tahoma" 
									Text="Action Pane" 
									Foreground="Black" 
									VerticalAlignment="Center" 
									Margin="5,0" 
									FontSize="12" 
									FontWeight="Bold"/>
							</Expander>													
							<Line Stroke="SlateGray" VerticalAlignment="Bottom" X2="1" Stretch="Fill" Grid.Row="0"/>
							<Grid Name="actionPaneGridWrapper" MinHeight="28" SnapsToDevicePixels="True" Grid.Row="1" ShowGridLines="True">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="*"></ColumnDefinition>									
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="*"></RowDefinition>									
								</Grid.RowDefinitions>
								<Grid Name="actionPaneGrid" 
									MinHeight="28" 
									SnapsToDevicePixels="True" 
									Grid.Row="0" 
									Visibility="Visible">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="*"></ColumnDefinition>
									</Grid.ColumnDefinitions>
									<Grid.RowDefinitions>									
										<RowDefinition Height="*"></RowDefinition>
										<RowDefinition Height="5"></RowDefinition>
										<RowDefinition Height="40"></RowDefinition>
									</Grid.RowDefinitions>
									<!--Container for Action View-->
									<ItemsControl CAL:RegionManager.RegionName="ActionRegion" Padding="1" Grid.Column="0" Grid.Row="0" 
										HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Background="Transparent" IsTabStop="False">
										<ItemsControl.ItemsPanel>
											<ItemsPanelTemplate>
												<DockPanel/>
											</ItemsPanelTemplate>
										</ItemsControl.ItemsPanel>
									</ItemsControl>
									<GridSplitter Grid.Row="2" Height="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" IsEnabled="False"></GridSplitter>
									<!--Container for Search View-->
									<ItemsControl CAL:RegionManager.RegionName="SearchRegion" Padding="1" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" 
										HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center" Background="Transparent" IsTabStop="False">
										<ItemsControl.ItemsPanel>
											<ItemsPanelTemplate>
												<DockPanel/>
											</ItemsPanelTemplate>
										</ItemsControl.ItemsPanel>
									</ItemsControl>
								</Grid>
							</Grid>
						</Grid>						
					</Border>					
				</Grid>
			</DockPanel>
		</Grid>
	</DockPanel>
</Window>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Mark Brownsword
Software Developer (Senior)
Australia Australia
I've been working as a software developer since 2000 and hold a Bachelor of Business degree from The Open Polytechnic of New Zealand. Computers are for people and I aim to build applications for people that they would want to use.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141216.1 | Last Updated 25 Sep 2009
Article Copyright 2009 by Mark Brownsword
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid