diff --git a/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml b/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml
index cfbb1ce666..b7269d3a12 100644
--- a/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml
+++ b/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml
@@ -1,29 +1,52 @@
-
-
-
+
+
+
+
-
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml.cs b/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml.cs
index 3c40d4c883..a2142ba99a 100644
--- a/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml.cs
+++ b/src/AddIns/Misc/StartPage/Project/Src/RecentProjectsControl.xaml.cs
@@ -28,7 +28,7 @@ namespace ICSharpCode.StartPage
{
InitializeComponent();
- SetBinding(HeaderProperty, new LocalizeExtension("StartPage.StartMenu.BarNameName").CreateBinding());
+ this.SetValueToExtension(HeaderProperty, new LocalizeExtension("StartPage.StartMenu.BarNameName"));
BuildRecentProjectList();
}
diff --git a/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml b/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml
index e00948bc13..54c7c75f0f 100644
--- a/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml
+++ b/src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml
@@ -73,11 +73,14 @@
Background="#A8C6E3"
Grid.Row="2"
Padding="4,0,4,0"
- TextWrapping="Wrap">
+ TextWrapping="WrapWithOverflow">
Copyright ©2000-2009
IC#SharpCode
+ NavigateUri="mailto:webmaster@icsharpcode.net">IC#SharpCode
+
+
+
\ No newline at end of file
diff --git a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonPadContent.cs b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonPadContent.cs
index 094b9f37ee..26266b8589 100644
--- a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonPadContent.cs
+++ b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonPadContent.cs
@@ -32,7 +32,7 @@ namespace ICSharpCode.SharpDevelop.Gui
this.layout = layout;
this.Name = descriptor.Class.Replace('.', '_');
- this.SetBinding(TitleProperty, new StringParseExtension(descriptor.Title).CreateBinding());
+ this.SetValueToExtension(TitleProperty, new StringParseExtension(descriptor.Title));
placeholder = new TextBlock { Text = this.Title };
this.Content = placeholder;
this.Icon = PresentationResourceService.GetPixelSnappedImage(descriptor.Icon);
diff --git a/src/Main/Base/Project/Src/Project/Converter/UpgradeView.xaml b/src/Main/Base/Project/Src/Project/Converter/UpgradeView.xaml
index 33bfca63f3..fcc2eb0a1a 100644
--- a/src/Main/Base/Project/Src/Project/Converter/UpgradeView.xaml
+++ b/src/Main/Base/Project/Src/Project/Converter/UpgradeView.xaml
@@ -1,113 +1,119 @@
-
-
-
-
-
-
-
-
- This solution was created using a previous version of SharpDevelop.
- You might want to upgrade it so that you can use new language or framework features.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ x:ClassModifier="internal"
+ x:Class="ICSharpCode.SharpDevelop.Project.Converter.UpgradeView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:core="http://icsharpcode.net/sharpdevelop/core">
+
+
+
+
+
+
+
+
+ This solution was created using a previous version of SharpDevelop.
+ You might want to upgrade it so that you can use new language or framework features.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Main/Base/Project/Src/TextEditor/Commands/ToolCommands.cs b/src/Main/Base/Project/Src/TextEditor/Commands/ToolCommands.cs
index 7a057f1de1..b867ce36da 100644
--- a/src/Main/Base/Project/Src/TextEditor/Commands/ToolCommands.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Commands/ToolCommands.cs
@@ -147,20 +147,4 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
}
}
-
- public class SplitTextEditor : AbstractMenuCommand
- {
- public override void Run()
- {
- IViewContent viewContent = WorkbenchSingleton.Workbench.ActiveViewContent;
-
- if (viewContent == null || !(viewContent is ITextEditorControlProvider)) {
- return;
- }
- TextEditorControl textEditorControl = ((ITextEditorControlProvider)viewContent).TextEditorControl;
- if (textEditorControl != null) {
- textEditorControl.Split();
- }
- }
- }
}
diff --git a/src/Main/ICSharpCode.Core.Presentation/ExtensionMethods.cs b/src/Main/ICSharpCode.Core.Presentation/ExtensionMethods.cs
new file mode 100644
index 0000000000..c5ae54438c
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/ExtensionMethods.cs
@@ -0,0 +1,65 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Windows;
+using System.Windows.Markup;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// ExtensionMethods that help with WPF.
+ ///
+ public static class ExtensionMethods
+ {
+ ///
+ /// Sets the value of a dependency property on using a markup extension.
+ ///
+ /// This method does not support markup extensions like x:Static that depend on
+ /// having a XAML file as context.
+ public static void SetValueToExtension(this DependencyObject targetObject, DependencyProperty property, MarkupExtension markupExtension)
+ {
+ if (targetObject == null)
+ throw new ArgumentNullException("targetObject");
+ if (property == null)
+ throw new ArgumentNullException("property");
+ if (markupExtension == null)
+ throw new ArgumentNullException("markupExtension");
+
+ var serviceProvider = new SetValueToExtensionServiceProvider(targetObject, property);
+ targetObject.SetValue(property, markupExtension.ProvideValue(serviceProvider));
+ }
+
+ sealed class SetValueToExtensionServiceProvider : IServiceProvider, IProvideValueTarget
+ {
+ readonly DependencyObject targetObject;
+ readonly DependencyProperty targetProperty;
+
+ public SetValueToExtensionServiceProvider(DependencyObject targetObject, DependencyProperty property)
+ {
+ this.targetObject = targetObject;
+ this.targetProperty = property;
+ }
+
+ public object GetService(Type serviceType)
+ {
+ if (serviceType == typeof(IProvideValueTarget))
+ return this;
+ else
+ return null;
+ }
+
+ public object TargetObject {
+ get { return targetObject; }
+ }
+
+ public object TargetProperty {
+ get { return targetProperty; }
+ }
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj b/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj
index 80ceb90472..30f9d94eee 100644
--- a/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj
+++ b/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj
@@ -67,9 +67,11 @@
Properties\GlobalAssemblyInfo.cs
+
+
diff --git a/src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs b/src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs
index 4702407b79..b774369fcc 100644
--- a/src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs
+++ b/src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs
@@ -69,18 +69,19 @@ namespace ICSharpCode.Core.Presentation
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (UpdateOnLanguageChange) {
- return CreateBinding().ProvideValue(serviceProvider);
+ Binding binding = new Binding("Value") { Source = this, Mode = BindingMode.OneWay };
+ return binding.ProvideValue(serviceProvider);
} else {
return this.Value;
}
}
+ [Obsolete("Use ExtensionMethods.SetValueToExtension instead of directly fetching the binding from this extension")]
public Binding CreateBinding()
{
return new Binding("Value") { Source = this, Mode = BindingMode.OneWay };
}
-
event System.ComponentModel.PropertyChangedEventHandler ChangedEvent;
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged {
diff --git a/src/Main/ICSharpCode.Core.Presentation/SortableGridViewColumn.cs b/src/Main/ICSharpCode.Core.Presentation/SortableGridViewColumn.cs
new file mode 100644
index 0000000000..a845c48ad4
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/SortableGridViewColumn.cs
@@ -0,0 +1,212 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.ComponentModel;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// Allows to automatically sort a grid view.
+ ///
+ public class SortableGridViewColumn : GridViewColumn
+ {
+ static readonly ComponentResourceKey headerTemplateKey = new ComponentResourceKey(typeof(SortableGridViewColumn), "ColumnHeaderTemplate");
+
+ public SortableGridViewColumn()
+ {
+ this.SetValueToExtension(HeaderTemplateProperty, new DynamicResourceExtension(headerTemplateKey));
+ }
+
+ string sortBy;
+
+ public string SortBy {
+ get { return sortBy; }
+ set {
+ if (sortBy != value) {
+ sortBy = value;
+ OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("SortBy"));
+ }
+ }
+ }
+
+ #region SortDirection property
+ public static readonly DependencyProperty SortDirectionProperty =
+ DependencyProperty.RegisterAttached("SortDirection", typeof(ColumnSortDirection), typeof(SortableGridViewColumn),
+ new FrameworkPropertyMetadata(ColumnSortDirection.None, OnSortDirectionChanged));
+
+ public ColumnSortDirection SortDirection {
+ get { return (ColumnSortDirection)GetValue(SortDirectionProperty); }
+ set { SetValue(SortDirectionProperty, value); }
+ }
+
+ public static ColumnSortDirection GetSortDirection(ListView listView)
+ {
+ return (ColumnSortDirection)listView.GetValue(SortDirectionProperty);
+ }
+
+ public static void SetSortDirection(ListView listView, ColumnSortDirection value)
+ {
+ listView.SetValue(SortDirectionProperty, value);
+ }
+
+ static void OnSortDirectionChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
+ {
+ ListView grid = sender as ListView;
+ if (grid != null) {
+ SortableGridViewColumn col = GetCurrentSortColumn(grid);
+ if (col != null)
+ col.SortDirection = (ColumnSortDirection)args.NewValue;
+ Sort(grid);
+ }
+ }
+ #endregion
+
+ #region CurrentSortColumn property
+ public static readonly DependencyProperty CurrentSortColumnProperty =
+ DependencyProperty.RegisterAttached("CurrentSortColumn", typeof(SortableGridViewColumn), typeof(SortableGridViewColumn),
+ new FrameworkPropertyMetadata(OnCurrentSortColumnChanged));
+
+ public static SortableGridViewColumn GetCurrentSortColumn(ListView listView)
+ {
+ return (SortableGridViewColumn)listView.GetValue(CurrentSortColumnProperty);
+ }
+
+ public static void SetCurrentSortColumn(ListView listView, SortableGridViewColumn value)
+ {
+ listView.SetValue(CurrentSortColumnProperty, value);
+ }
+
+ static void OnCurrentSortColumnChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
+ {
+ ListView grid = sender as ListView;
+ if (grid != null) {
+ SortableGridViewColumn oldColumn = (SortableGridViewColumn)args.OldValue;
+ if (oldColumn != null)
+ oldColumn.SortDirection = ColumnSortDirection.None;
+ SortableGridViewColumn newColumn = (SortableGridViewColumn)args.NewValue;
+ if (newColumn != null) {
+ newColumn.SortDirection = GetSortDirection(grid);
+ }
+ Sort(grid);
+ }
+ }
+ #endregion
+
+ #region SortMode property
+ public static readonly DependencyProperty SortModeProperty =
+ DependencyProperty.RegisterAttached("SortMode", typeof(ListViewSortMode), typeof(SortableGridViewColumn),
+ new FrameworkPropertyMetadata(ListViewSortMode.None, OnSortModeChanged));
+
+ public static ListViewSortMode GetSortMode(ListView listView)
+ {
+ return (ListViewSortMode)listView.GetValue(SortModeProperty);
+ }
+
+ public static void SetSortMode(ListView listView, ListViewSortMode value)
+ {
+ listView.SetValue(SortModeProperty, value);
+ }
+
+ static void OnSortModeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
+ {
+ ListView grid = sender as ListView;
+ if (grid != null) {
+ if ((ListViewSortMode)args.NewValue != ListViewSortMode.None)
+ grid.AddHandler(GridViewColumnHeader.ClickEvent, new RoutedEventHandler(GridViewColumnHeaderClickHandler));
+ else
+ grid.RemoveHandler(GridViewColumnHeader.ClickEvent, new RoutedEventHandler(GridViewColumnHeaderClickHandler));
+ }
+ }
+
+ static void GridViewColumnHeaderClickHandler(object sender, RoutedEventArgs e)
+ {
+ ListView grid = sender as ListView;
+ GridViewColumnHeader headerClicked = e.OriginalSource as GridViewColumnHeader;
+ if (grid != null && headerClicked != null && headerClicked.Role != GridViewColumnHeaderRole.Padding) {
+ if (headerClicked.Column == GetCurrentSortColumn(grid)) {
+ if (GetSortDirection(grid) == ColumnSortDirection.Ascending)
+ SetSortDirection(grid, ColumnSortDirection.Descending);
+ else
+ SetSortDirection(grid, ColumnSortDirection.Ascending);
+ } else {
+ SetSortDirection(grid, ColumnSortDirection.Ascending);
+ SetCurrentSortColumn(grid, headerClicked.Column as SortableGridViewColumn);
+ }
+ }
+ }
+ #endregion
+
+ static void Sort(ListView grid)
+ {
+ ColumnSortDirection currentDirection = GetSortDirection(grid);
+ SortableGridViewColumn column = GetCurrentSortColumn(grid);
+ if (column != null && GetSortMode(grid) == ListViewSortMode.Automatic && currentDirection != ColumnSortDirection.None) {
+ ICollectionView dataView = CollectionViewSource.GetDefaultView(grid.ItemsSource);
+
+ string sortBy = column.SortBy;
+ if (sortBy == null) {
+ Binding binding = column.DisplayMemberBinding as Binding;
+ if (binding != null && binding.Path != null) {
+ sortBy = binding.Path.Path;
+ }
+ }
+
+ dataView.SortDescriptions.Clear();
+ if (sortBy != null) {
+ ListSortDirection direction;
+ if (currentDirection == ColumnSortDirection.Descending)
+ direction = ListSortDirection.Descending;
+ else
+ direction = ListSortDirection.Ascending;
+ dataView.SortDescriptions.Add(new SortDescription(sortBy, direction));
+ }
+ dataView.Refresh();
+ }
+ }
+ }
+
+ public enum ColumnSortDirection
+ {
+ None,
+ Ascending,
+ Descending
+ }
+
+ public enum ListViewSortMode
+ {
+ ///
+ /// Disable automatic sorting when sortable columns are clicked.
+ ///
+ None,
+ ///
+ /// Fully automatic sorting.
+ ///
+ Automatic,
+ ///
+ /// Automatically update SortDirection and CurrentSortColumn properties,
+ /// but do not actually sort the data.
+ ///
+ HalfAutomatic
+ }
+
+ sealed class ColumnSortDirectionToVisibilityConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+ {
+ return Equals(value, parameter) ? Visibility.Visible : Visibility.Collapsed;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+ {
+ throw new NotSupportedException();
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/themes/Aero.NormalColor.xaml b/src/Main/ICSharpCode.Core.Presentation/themes/Aero.NormalColor.xaml
index a675e83458..5608afc749 100644
--- a/src/Main/ICSharpCode.Core.Presentation/themes/Aero.NormalColor.xaml
+++ b/src/Main/ICSharpCode.Core.Presentation/themes/Aero.NormalColor.xaml
@@ -2,6 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ICSharpCode.Core.Presentation"
>
+
diff --git a/src/Main/ICSharpCode.Core.Presentation/themes/generic.xaml b/src/Main/ICSharpCode.Core.Presentation/themes/generic.xaml
index d8e3b8cbb5..79c5c79295 100644
--- a/src/Main/ICSharpCode.Core.Presentation/themes/generic.xaml
+++ b/src/Main/ICSharpCode.Core.Presentation/themes/generic.xaml
@@ -2,10 +2,12 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ICSharpCode.Core.Presentation"
>
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file