Browse Source

Restore XamlDesigner to match old WPF Designer version

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4781 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 16 years ago
parent
commit
8429b4a3af
  1. 2
      samples/XamlDesigner/App.xaml.cs
  2. 196
      samples/XamlDesigner/Document.cs
  3. 14
      samples/XamlDesigner/DocumentView.xaml
  4. 102
      samples/XamlDesigner/DocumentView.xaml.cs
  5. 4
      samples/XamlDesigner/ErrorListView.xaml
  6. 3
      samples/XamlDesigner/ErrorListView.xaml.cs
  7. BIN
      samples/XamlDesigner/Images/Control.png
  8. BIN
      samples/XamlDesigner/Images/Folder.png
  9. 56
      samples/XamlDesigner/MainWindow.xaml
  10. 26
      samples/XamlDesigner/MainWindow.xaml.cs
  11. 125
      samples/XamlDesigner/MainWindow_Commands.cs
  12. 3
      samples/XamlDesigner/Properties/AssemblyInfo.cs
  13. 110
      samples/XamlDesigner/Properties/Settings.Designer.cs
  14. 46
      samples/XamlDesigner/Properties/Settings.settings
  15. 29
      samples/XamlDesigner/Properties/app.manifest
  16. 45
      samples/XamlDesigner/Shell.cs
  17. 10
      samples/XamlDesigner/TestFiles/grid.xaml
  18. 5
      samples/XamlDesigner/Toolbox.cs
  19. 26
      samples/XamlDesigner/ToolboxTreeView.cs
  20. 65
      samples/XamlDesigner/XamlDesigner.csproj
  21. 25
      samples/XamlDesigner/XamlDesigner.sln
  22. 51
      samples/XamlDesigner/app.config

2
samples/XamlDesigner/App.xaml.cs

@ -4,7 +4,7 @@ using System.Configuration;
using System.Data; using System.Data;
using System.Linq; using System.Linq;
using System.Windows; using System.Windows;
using ICSharpCode.XamlDesigner.Properties; using ICSharpCode.XamlDesigner.Configuration;
using System.Windows.Threading; using System.Windows.Threading;
using System.Diagnostics; using System.Diagnostics;

196
samples/XamlDesigner/Document.cs

@ -5,7 +5,7 @@ using System.Text;
using System.ComponentModel; using System.ComponentModel;
using System.IO; using System.IO;
using ICSharpCode.WpfDesign.Designer; using ICSharpCode.WpfDesign.Designer;
using ICSharpCode.WpfDesign.Designer.XamlBackend; using ICSharpCode.WpfDesign.Designer.Xaml;
using ICSharpCode.WpfDesign.Designer.OutlineView; using ICSharpCode.WpfDesign.Designer.OutlineView;
using System.Xml; using System.Xml;
using ICSharpCode.WpfDesign; using ICSharpCode.WpfDesign;
@ -17,41 +17,28 @@ namespace ICSharpCode.XamlDesigner
public class Document : INotifyPropertyChanged public class Document : INotifyPropertyChanged
{ {
public Document(string tempName, string text) public Document(string tempName, string text)
: this()
{ {
this.tempName = tempName; this.tempName = tempName;
Text = text; Text = text;
Context.Parse(Text);
IsDirty = false; IsDirty = false;
} }
public Document(string filePath) public Document(string filePath)
: this()
{ {
this.filePath = filePath; this.filePath = filePath;
ReloadFile(); ReloadFile();
} }
Document()
{
var doc = Shell.Instance.Project.CreateDocument();
context = new XamlDesignContext(doc);
context.UndoService.UndoStackChanged += new EventHandler(UndoService_UndoStackChanged);
}
string tempName; string tempName;
XamlDesignContext context; DesignSurface designSurface = new DesignSurface();
string text; string text;
public string Text public string Text {
{ get {
get
{
return text; return text;
} }
set set {
{
if (text != value) { if (text != value) {
text = value; text = value;
IsDirty = true; IsDirty = true;
@ -62,47 +49,39 @@ namespace ICSharpCode.XamlDesigner
DocumentMode mode; DocumentMode mode;
public DocumentMode Mode public DocumentMode Mode {
{ get {
get
{
return mode; return mode;
} }
set set {
{
mode = value; mode = value;
//if (InDesignMode) { if (InDesignMode) {
// UpdateDesign(); UpdateDesign();
//} }
//else { else {
// UpdateXaml(); UpdateXaml();
//} }
RaisePropertyChanged("Mode"); RaisePropertyChanged("Mode");
RaisePropertyChanged("InXamlMode"); RaisePropertyChanged("InXamlMode");
RaisePropertyChanged("InDesignMode"); RaisePropertyChanged("InDesignMode");
} }
} }
public bool InXamlMode public bool InXamlMode {
{
get { return Mode == DocumentMode.Xaml; } get { return Mode == DocumentMode.Xaml; }
} }
public bool InDesignMode public bool InDesignMode {
{
get { return Mode == DocumentMode.Design; } get { return Mode == DocumentMode.Design; }
} }
string filePath; string filePath;
public string FilePath public string FilePath {
{ get {
get
{
return filePath; return filePath;
} }
private set private set {
{
filePath = value; filePath = value;
RaisePropertyChanged("FilePath"); RaisePropertyChanged("FilePath");
RaisePropertyChanged("FileName"); RaisePropertyChanged("FileName");
@ -113,14 +92,11 @@ namespace ICSharpCode.XamlDesigner
bool isDirty; bool isDirty;
public bool IsDirty public bool IsDirty {
{ get {
get
{
return isDirty; return isDirty;
} }
private set private set {
{
isDirty = value; isDirty = value;
RaisePropertyChanged("IsDirty"); RaisePropertyChanged("IsDirty");
RaisePropertyChanged("Name"); RaisePropertyChanged("Name");
@ -128,59 +104,79 @@ namespace ICSharpCode.XamlDesigner
} }
} }
public string FileName public string FileName {
{ get {
get
{
if (FilePath == null) return null; if (FilePath == null) return null;
return Path.GetFileName(FilePath); return Path.GetFileName(FilePath);
} }
} }
public string Name public string Name {
{ get {
get
{
return FileName ?? tempName; return FileName ?? tempName;
} }
} }
public string Title public string Title {
{ get {
get
{
return IsDirty ? Name + "*" : Name; return IsDirty ? Name + "*" : Name;
} }
} }
public DesignContext Context public DesignSurface DesignSurface {
{ get { return designSurface; }
get { return context; }
} }
//TODO public DesignContext DesignContext {
//public XamlErrorService XamlErrorService { get { return designSurface.DesignContext; }
// get { }
// if (DesignContext != null) {
// return DesignContext.GetService<XamlErrorService>(); public UndoService UndoService {
// } get { return DesignContext.Services.GetService<UndoService>(); }
// return null; }
// }
//} public ISelectionService SelectionService {
get {
if (InDesignMode) {
return DesignContext.Services.Selection;
}
return null;
}
}
public XamlErrorService XamlErrorService {
get {
if (DesignContext != null) {
return DesignContext.Services.GetService<XamlErrorService>();
}
return null;
}
}
OutlineNode outlineRoot;
public OutlineNode OutlineRoot {
get {
return outlineRoot;
}
private set {
outlineRoot = value;
RaisePropertyChanged("OutlineRoot");
}
}
void ReloadFile() void ReloadFile()
{ {
Text = File.ReadAllText(FilePath); Text = File.ReadAllText(FilePath);
//UpdateDesign(); UpdateDesign();
Context.Parse(Text);
IsDirty = false; IsDirty = false;
} }
public void Save() public void Save()
{ {
//if (InDesignMode) { if (InDesignMode) {
// UpdateXaml(); UpdateXaml();
//} }
File.WriteAllText(FilePath, Text); File.WriteAllText(FilePath, Text);
IsDirty = false; IsDirty = false;
} }
@ -193,33 +189,41 @@ namespace ICSharpCode.XamlDesigner
public void Refresh() public void Refresh()
{ {
//UpdateXaml(); UpdateXaml();
//UpdateDesign(); UpdateDesign();
} }
//void UpdateXaml() void UpdateXaml()
//{ {
// if (Context.CanSave) { if (DesignContext.CanSave && UndoService.CanUndo) {
// Text = Context.Save(); var sb = new StringBuilder();
// } using (var xmlWriter = XmlWriter.Create(sb)) {
//} DesignSurface.SaveDesigner(xmlWriter);
Text = XamlFormatter.Format(sb.ToString());
}
}
}
//void UpdateDesign() void UpdateDesign()
//{ {
// Context.Parse(Text); OutlineRoot = null;
//} using (var xmlReader = XmlReader.Create(new StringReader(Text))) {
DesignSurface.LoadDesigner(xmlReader, null);
}
if (DesignContext.RootItem != null) {
OutlineRoot = OutlineNode.Create(DesignContext.RootItem);
UndoService.UndoStackChanged += new EventHandler(UndoService_UndoStackChanged);
}
RaisePropertyChanged("SelectionService");
RaisePropertyChanged("XamlErrorService");
}
void UndoService_UndoStackChanged(object sender, EventArgs e) void UndoService_UndoStackChanged(object sender, EventArgs e)
{ {
IsDirty = Context.UndoService.CanUndo; IsDirty = true;
if (Context.ParseSuggested) { if (InXamlMode) {
Context.Parse(Text); UpdateXaml();
} }
//if (Context.Is
//IsDirty = true;
//if (InXamlMode) {
// UpdateXaml();
//}
} }
#region INotifyPropertyChanged Members #region INotifyPropertyChanged Members

14
samples/XamlDesigner/DocumentView.xaml

@ -1,21 +1,21 @@
<UserControl x:Class="ICSharpCode.XamlDesigner.DocumentView" <UserControl
x:Class="ICSharpCode.XamlDesigner.DocumentView"
xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation" xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Integration="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" xmlns:Integration="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:TextEditor="clr-namespace:ICSharpCode.TextEditor;assembly=ICSharpCode.TextEditor"
xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner" xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner"
xmlns:Designer="clr-namespace:ICSharpCode.WpfDesign.Designer;assembly=ICSharpCode.WpfDesign.Designer" xmlns:DesignerControls="clr-namespace:ICSharpCode.WpfDesign.Designer.Controls;assembly=ICSharpCode.WpfDesign.Designer"
xmlns:DesignerControls="clr-namespace:ICSharpCode.WpfDesign.Designer.Controls;assembly=ICSharpCode.WpfDesign.Designer"> >
<DockPanel> <DockPanel>
<DesignerControls:EnumBar Value="{Binding Mode}" <DesignerControls:EnumBar Value="{Binding Mode}"
DockPanel.Dock="Bottom"/> DockPanel.Dock="Bottom"/>
<Grid> <Grid>
<Integration:WindowsFormsHost Visibility="{Binding InXamlMode, Converter={StaticResource CollapsedWhenFalse}}"> <Integration:WindowsFormsHost Visibility="{Binding InXamlMode, Converter={StaticResource CollapsedWhenFalse}}">
<Default:TextEditorWithoutUndo x:Name="uxTextEditor" /> <TextEditor:TextEditorControl x:Name="uxTextEditor" />
</Integration:WindowsFormsHost> </Integration:WindowsFormsHost>
<ContentPresenter Content="{Binding DesignSurface}"
<Designer:DesignSurface x:Name="uxDesignSurface"
Context="{Binding Context}"
Visibility="{Binding InDesignMode, Converter={StaticResource CollapsedWhenFalse}}"/> Visibility="{Binding InDesignMode, Converter={StaticResource CollapsedWhenFalse}}"/>
</Grid> </Grid>
</DockPanel> </DockPanel>

102
samples/XamlDesigner/DocumentView.xaml.cs

@ -13,13 +13,6 @@ using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using ICSharpCode.WpfDesign.Designer.Services; using ICSharpCode.WpfDesign.Designer.Services;
using System.Windows.Threading; using System.Windows.Threading;
using ICSharpCode.Xaml;
using ICSharpCode.WpfDesign.Designer;
using ICSharpCode.TextEditor;
using System.Windows.Forms;
using ICSharpCode.TextEditor.Document;
using ICSharpCode.WpfDesign;
using ICSharpCode.TextEditor.Undo;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.XamlDesigner
{ {
@ -29,106 +22,21 @@ namespace ICSharpCode.XamlDesigner
{ {
InitializeComponent(); InitializeComponent();
ShellDocument = doc; Document = doc;
Shell.Instance.Views[doc] = this; Shell.Instance.Views[doc] = this;
uxTextEditor.SetHighlighting("XML"); uxTextEditor.SetHighlighting("XML");
uxTextEditor.DataBindings.Add("Text", doc, "Text", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged); uxTextEditor.DataBindings.Add("Text", doc, "Text", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
ShellDocument.Context.AddService(typeof(ITextContainer), uxTextEditor);
uxTextEditor.Document.UndoStack.OperationPushed += UndoStack_OperationPushed;
uxTextEditor.Document.DocumentChanged += Document_DocumentChanged;
uxTextEditor.Document.DocumentAboutToBeChanged += Document_DocumentAboutToBeChanged;
}
public Document ShellDocument { get; private set; }
IUndoableOperation lastOperation;
bool textValid;
void Document_DocumentAboutToBeChanged(object sender, DocumentEventArgs e)
{
textValid = false;
} }
void Document_DocumentChanged(object sender, DocumentEventArgs e) public Document Document { get; private set; }
{
textValid = true;
TryUpdateDesignUndoStack();
}
void UndoStack_OperationPushed(object sender, OperationEventArgs e)
{
lastOperation = e.Operation;
TryUpdateDesignUndoStack();
}
void TryUpdateDesignUndoStack() public void JumpToError(XamlError error)
{ {
if (textValid && lastOperation != null) { Document.Mode = DocumentMode.Xaml;
ShellDocument.Context.UndoService.Done(new TextAction(lastOperation));
lastOperation = null;
}
}
public DesignSurface DesignSurface
{
get
{
return uxDesignSurface;
}
}
public void JumpToError(XamlDocumentError error)
{
ShellDocument.Mode = DocumentMode.Xaml;
Dispatcher.BeginInvoke(new Action(delegate { Dispatcher.BeginInvoke(new Action(delegate {
uxTextEditor.ActiveTextAreaControl.JumpTo(error.LineNumber - 1, error.LinePosition - 1); uxTextEditor.ActiveTextAreaControl.JumpTo(error.Line - 1, error.Column - 1);
}), DispatcherPriority.Background); }), DispatcherPriority.Background);
} }
} }
class TextEditorWithoutUndo : TextEditorControl, ITextContainer
{
public TextEditorWithoutUndo()
{
editactions.Remove(Keys.Control | Keys.Z);
editactions.Remove(Keys.Control | Keys.Y);
}
public override void EndUpdate()
{
base.EndUpdate();
}
}
class TextAction : ITextAction
{
public TextAction(IUndoableOperation op)
{
this.op = op;
}
IUndoableOperation op;
public IEnumerable<DesignItem> AffectedItems
{
get { yield break; }
}
public string Title
{
get { return "Text Editing"; }
}
public void Do()
{
op.Redo();
}
public void Undo()
{
op.Undo();
}
}
} }

4
samples/XamlDesigner/ErrorListView.xaml

@ -1,9 +1,9 @@
<ListBox x:Class="ICSharpCode.XamlDesigner.ErrorListView" <ListBox x:Class="ICSharpCode.XamlDesigner.ErrorListView"
xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation" xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Xaml="clr-namespace:ICSharpCode.Xaml;assembly=ICSharpCode.Xaml"> xmlns:Services="clr-namespace:ICSharpCode.WpfDesign.Designer.Services;assembly=ICSharpCode.WpfDesign.Designer">
<Control.Resources> <Control.Resources>
<DataTemplate DataType="{x:Type Xaml:XamlDocumentError}"> <DataTemplate DataType="{x:Type Services:XamlError}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Image Source="Images/Error.png" <Image Source="Images/Error.png"
Stretch="None" Stretch="None"

3
samples/XamlDesigner/ErrorListView.xaml.cs

@ -12,7 +12,6 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using ICSharpCode.WpfDesign.Designer.Services; using ICSharpCode.WpfDesign.Designer.Services;
using ICSharpCode.Xaml;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.XamlDesigner
{ {
@ -25,7 +24,7 @@ namespace ICSharpCode.XamlDesigner
protected override void OnMouseDoubleClick(MouseButtonEventArgs e) protected override void OnMouseDoubleClick(MouseButtonEventArgs e)
{ {
var error = e.GetDataContext() as XamlDocumentError; var error = e.GetDataContext() as XamlError;
if (error != null) { if (error != null) {
Shell.Instance.JumpToError(error); Shell.Instance.JumpToError(error);
} }

BIN
samples/XamlDesigner/Images/Control.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 470 B

BIN
samples/XamlDesigner/Images/Folder.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

56
samples/XamlDesigner/MainWindow.xaml

@ -5,12 +5,45 @@
xmlns:sd="http://sharpdevelop.net" xmlns:sd="http://sharpdevelop.net"
xmlns:AvalonDock="clr-namespace:AvalonDock;assembly=AvalonDock" xmlns:AvalonDock="clr-namespace:AvalonDock;assembly=AvalonDock"
xmlns:Outline="clr-namespace:ICSharpCode.WpfDesign.Designer.OutlineView;assembly=ICSharpCode.WpfDesign.Designer" xmlns:Outline="clr-namespace:ICSharpCode.WpfDesign.Designer.OutlineView;assembly=ICSharpCode.WpfDesign.Designer"
xmlns:Designer="clr-namespace:ICSharpCode.WpfDesign.Designer;assembly=ICSharpCode.WpfDesign.Designer"
xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner" xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner"
SnapsToDevicePixels="True" SnapsToDevicePixels="True"
AllowDrop="True" AllowDrop="True"
Title="{Binding Title}"> Title="{Binding Title}">
<Window.CommandBindings>
<CommandBinding Command="New"
Executed="NewCommand_Executed" />
<CommandBinding Command="Open"
Executed="OpenCommand_Executed" />
<CommandBinding Command="Close"
Executed="CloseCommand_Executed"
CanExecute="CurrentDocument_CanExecute"
PreviewExecuted="CloseCommand_PreviewExecuted"/>
<CommandBinding Command="Default:MainWindow.CloseAllCommand"
Executed="CloseAllCommand_Executed"
CanExecute="CurrentDocument_CanExecute" />
<CommandBinding Command="Save"
Executed="SaveCommand_Executed"
CanExecute="CurrentDocument_CanExecute" />
<CommandBinding Command="SaveAs"
Executed="SaveAsCommand_Executed"
CanExecute="CurrentDocument_CanExecute" />
<CommandBinding Command="Default:MainWindow.SaveAllCommand"
Executed="SaveAllCommand_Executed"
CanExecute="CurrentDocument_CanExecute" />
<CommandBinding Command="Default:MainWindow.ExitCommand"
Executed="ExitCommand_Executed" />
</Window.CommandBindings>
<DockPanel> <DockPanel>
<Menu DockPanel.Dock="Top"> <Menu DockPanel.Dock="Top">
@ -55,32 +88,27 @@
SelectedValuePath="DataContext"/> SelectedValuePath="DataContext"/>
<AvalonDock:DockablePane> <AvalonDock:DockablePane>
<AvalonDock:DockableContent x:Name="content1" <AvalonDock:DockableContent x:Name="content1" Title="Toolbox">
Title="Toolbox"> <Default:ToolboxView />
<Designer:Toolbox x:Name="uxToolbox"
Context="{Binding CurrentDocument.Context}" />
</AvalonDock:DockableContent> </AvalonDock:DockableContent>
</AvalonDock:DockablePane> </AvalonDock:DockablePane>
<AvalonDock:DockablePane> <AvalonDock:DockablePane>
<AvalonDock:DockableContent x:Name="content2" <AvalonDock:DockableContent x:Name="content2" Title="Outline">
Title="Outline"> <Outline:Outline Root="{Binding CurrentDocument.OutlineRoot}"/>
<Outline:Outline Context="{Binding CurrentDocument.Context}" />
</AvalonDock:DockableContent> </AvalonDock:DockableContent>
</AvalonDock:DockablePane> </AvalonDock:DockablePane>
<AvalonDock:DockablePane> <AvalonDock:DockablePane>
<AvalonDock:DockableContent x:Name="content3" <AvalonDock:DockableContent x:Name="content3" Title="Errors">
Title="Errors"> <Default:ErrorListView ItemsSource="{Binding CurrentDocument.XamlErrorService.Errors}"/>
<Default:ErrorListView ItemsSource="{Binding CurrentDocument.Context.Document.Errors}" />
</AvalonDock:DockableContent> </AvalonDock:DockableContent>
</AvalonDock:DockablePane> </AvalonDock:DockablePane>
<AvalonDock:DockablePane> <AvalonDock:DockablePane>
<AvalonDock:DockableContent x:Name="content4" <AvalonDock:DockableContent x:Name="content4" Title="Properties">
Title="Properties">
<sd:PropertyGridView x:Name="uxPropertyGridView" <sd:PropertyGridView x:Name="uxPropertyGridView"
Context="{Binding CurrentDocument.Context}" /> SelectedItems="{Binding DataContext.CurrentDocument.SelectionService.SelectedItems, ElementName=root, FallbackValue={x:Null}}"/>
</AvalonDock:DockableContent> </AvalonDock:DockableContent>
</AvalonDock:DockablePane> </AvalonDock:DockablePane>

26
samples/XamlDesigner/MainWindow.xaml.cs

@ -10,14 +10,13 @@ using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
using ICSharpCode.XamlDesigner.Properties; using ICSharpCode.XamlDesigner.Configuration;
using System.ComponentModel; using System.ComponentModel;
using Microsoft.Win32; using Microsoft.Win32;
using AvalonDock; using AvalonDock;
using System.IO; using System.IO;
using System.Collections.Specialized; using System.Collections.Specialized;
using ICSharpCode.WpfDesign.Designer; using ICSharpCode.WpfDesign.Designer;
using ICSharpCode.Xaml;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.XamlDesigner
{ {
@ -28,12 +27,15 @@ namespace ICSharpCode.XamlDesigner
Instance = this; Instance = this;
DataContext = Shell.Instance; DataContext = Shell.Instance;
RenameCommands(); RenameCommands();
BasicMetadata.Register();
InitializeComponent(); InitializeComponent();
Shell.Instance.PropertyGrid = uxPropertyGridView.PropertyGrid; Shell.Instance.PropertyGrid = uxPropertyGridView.PropertyGrid;
AvalonDockWorkaround(); AvalonDockWorkaround();
RegisterCommandHandlers(); RouteDesignSurfaceCommands();
this.AddCommandHandler(RefreshCommand, Shell.Instance.Refresh, Shell.Instance.CanRefresh);
LoadSettings(); LoadSettings();
ProcessPaths(App.Args); ProcessPaths(App.Args);
@ -87,7 +89,7 @@ namespace ICSharpCode.XamlDesigner
e.Effects = DragDropEffects.Copy; e.Effects = DragDropEffects.Copy;
break; break;
} }
else if (XamlConstants.HasXamlExtension(path)) { else if (path.EndsWith(".xaml", StringComparison.InvariantCultureIgnoreCase)) {
e.Effects = DragDropEffects.Copy; e.Effects = DragDropEffects.Copy;
break; break;
} }
@ -97,12 +99,11 @@ namespace ICSharpCode.XamlDesigner
void ProcessPaths(IEnumerable<string> paths) void ProcessPaths(IEnumerable<string> paths)
{ {
foreach (var path in paths) { foreach (var path in paths) {
//if (path.EndsWith(".dll", StringComparison.InvariantCultureIgnoreCase) || if (path.EndsWith(".dll", StringComparison.InvariantCultureIgnoreCase) ||
// path.EndsWith(".exe", StringComparison.InvariantCultureIgnoreCase)) { path.EndsWith(".exe", StringComparison.InvariantCultureIgnoreCase)) {
// Toolbox.Instance.AddAssembly(path); Toolbox.Instance.AddAssembly(path);
//} }
//else else if (path.EndsWith(".xaml", StringComparison.InvariantCultureIgnoreCase)) {
if (XamlConstants.HasXamlExtension(path)) {
Shell.Instance.Open(path); Shell.Instance.Open(path);
} }
} }
@ -148,11 +149,6 @@ namespace ICSharpCode.XamlDesigner
if (Settings.Default.AvalonDockLayout != null) { if (Settings.Default.AvalonDockLayout != null) {
uxDockingManager.RestoreLayout(Settings.Default.AvalonDockLayout.ToStream()); uxDockingManager.RestoreLayout(Settings.Default.AvalonDockLayout.ToStream());
} }
var toolboxContentPath = "WpfToolbox.xaml";
if (File.Exists(toolboxContentPath)) {
uxToolbox.Load(File.ReadAllText(toolboxContentPath));
}
} }
void SaveSettings() void SaveSettings()

125
samples/XamlDesigner/MainWindow_Commands.cs

@ -4,8 +4,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Input; using System.Windows.Input;
using System.Windows; using System.Windows;
using ICSharpCode.WpfDesign.Designer;
using ICSharpCode.WpfDesign;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.XamlDesigner
{ {
@ -22,122 +20,81 @@ namespace ICSharpCode.XamlDesigner
ApplicationCommands.SaveAs.Text = "Save As..."; ApplicationCommands.SaveAs.Text = "Save As...";
} }
void RegisterCommandHandlers() void NewCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{ {
this.AddCommandHandler(ApplicationCommands.New, Shell.Instance.New); Shell.Instance.New();
this.AddCommandHandler(ApplicationCommands.Open, Shell.Instance.Open);
this.AddCommandHandler(ApplicationCommands.Close, Shell.Instance.CloseCurrentDocument, HasCurrentDocument);
this.AddCommandHandler(ApplicationCommands.Save, Shell.Instance.SaveCurrentDocument, HasCurrentDocument);
this.AddCommandHandler(ApplicationCommands.SaveAs, Shell.Instance.SaveCurrentDocumentAs, HasCurrentDocument);
this.AddCommandHandler(SaveAllCommand, SaveAll, HasCurrentDocument);
this.AddCommandHandler(CloseAllCommand, CloseAll, HasCurrentDocument);
this.AddCommandHandler(ExitCommand, Shell.Instance.Exit, HasCurrentDocument);
this.AddCommandHandler(RefreshCommand, Shell.Instance.Refresh, Shell.Instance.CanRefresh);
this.AddCommandHandler(ApplicationCommands.Undo, Undo, CanUndo);
this.AddCommandHandler(ApplicationCommands.Redo, Redo, CanRedo);
this.AddCommandHandler(ApplicationCommands.Copy, Copy, CanCopy);
this.AddCommandHandler(ApplicationCommands.Cut, Cut, CanCut);
this.AddCommandHandler(ApplicationCommands.Delete, Delete, CanDelete);
this.AddCommandHandler(ApplicationCommands.Paste, Paste, CanPaste);
this.AddCommandHandler(ApplicationCommands.SelectAll, SelectAll, CanSelectAll);
}
bool HasCurrentDocument()
{
return Shell.Instance.CurrentDocument != null;
}
void SaveAll()
{
Shell.Instance.SaveAll();
}
void CloseAll()
{
Shell.Instance.CloseAll();
}
ICommandService CurrentCommandService
{
get
{
if (Shell.Instance.CurrentDocument != null) {
return Shell.Instance.CurrentDocument.Context.CommandService;
}
return null;
}
}
void Undo()
{
CurrentCommandService.Undo();
}
void Redo()
{
CurrentCommandService.Redo();
}
void Copy()
{
CurrentCommandService.Copy();
} }
void Paste() void OpenCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{ {
CurrentCommandService.Paste(); Shell.Instance.Open();
} }
void Cut() void CloseCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{ {
CurrentCommandService.Cut(); Shell.Instance.CloseCurrentDocument();
} }
void SelectAll() void CloseCommand_PreviewExecuted(object sender, ExecutedRoutedEventArgs e)
{ {
CurrentCommandService.SelectAll(); Shell.Instance.CloseCurrentDocument();
} }
void Delete() void CloseAllCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{ {
CurrentCommandService.Delete(); Shell.Instance.CloseAll();
} }
bool CanUndo() void SaveCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{ {
return CurrentCommandService != null && CurrentCommandService.CanUndo(); Shell.Instance.SaveCurrentDocument();
} }
bool CanRedo() void SaveAsCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{ {
return CurrentCommandService != null && CurrentCommandService.CanRedo(); Shell.Instance.SaveCurrentDocumentAs();
} }
bool CanCopy() void SaveAllCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{ {
return CurrentCommandService != null && CurrentCommandService.CanCopy(); Shell.Instance.SaveAll();
} }
bool CanPaste() void ExitCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{ {
return CurrentCommandService != null && CurrentCommandService.CanPaste(); Shell.Instance.Exit();
} }
bool CanCut() void CurrentDocument_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{ {
return CurrentCommandService != null && CurrentCommandService.CanCut(); e.CanExecute = Shell.Instance.CurrentDocument != null;
} }
bool CanSelectAll() void RouteDesignSurfaceCommands()
{ {
return CurrentCommandService != null && CurrentCommandService.CanSelectAll(); RouteDesignSurfaceCommand(ApplicationCommands.Undo);
RouteDesignSurfaceCommand(ApplicationCommands.Redo);
RouteDesignSurfaceCommand(ApplicationCommands.Copy);
RouteDesignSurfaceCommand(ApplicationCommands.Cut);
RouteDesignSurfaceCommand(ApplicationCommands.Paste);
RouteDesignSurfaceCommand(ApplicationCommands.SelectAll);
RouteDesignSurfaceCommand(ApplicationCommands.Delete);
} }
bool CanDelete() void RouteDesignSurfaceCommand(RoutedCommand command)
{ {
return CurrentCommandService != null && CurrentCommandService.CanDelete(); var cb = new CommandBinding(command);
cb.CanExecute += delegate(object sender, CanExecuteRoutedEventArgs e) {
if (Shell.Instance.CurrentDocument != null) {
Shell.Instance.CurrentDocument.DesignSurface.RaiseEvent(e);
}else {
e.CanExecute = false;
}
};
cb.Executed += delegate(object sender, ExecutedRoutedEventArgs e) {
Shell.Instance.CurrentDocument.DesignSurface.RaiseEvent(e);
};
CommandBindings.Add(cb);
} }
} }
} }

3
samples/XamlDesigner/Properties/AssemblyInfo.cs

@ -1,3 +0,0 @@
using System.Windows;
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]

110
samples/XamlDesigner/Properties/Settings.Designer.cs generated

@ -1,110 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ICSharpCode.XamlDesigner.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0,0,0,0")]
public global::System.Windows.Rect MainWindowRect {
get {
return ((global::System.Windows.Rect)(this["MainWindowRect"]));
}
set {
this["MainWindowRect"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute(@"<DockingManager>
<ResizingPanel Orientation=""Horizontal"">
<ResizingPanel ResizeWidth=""200"" Orientation=""Vertical"">
<DockablePane ResizeHeight=""441.36166666666668"" Anchor=""Left"">
<DockableContent Name=""content1"" AutoHide=""false"" />
</DockablePane>
<DockablePane ResizeWidth=""200"" Anchor=""Left"">
<DockableContent Name=""content2"" AutoHide=""false"" />
</DockablePane>
</ResizingPanel>
<ResizingPanel Orientation=""Vertical"">
<DocumentPanePlaceHolder />
<DockablePane ResizeHeight=""138"" Anchor=""Bottom"">
<DockableContent Name=""content3"" AutoHide=""false"" />
</DockablePane>
</ResizingPanel>
<DockablePane ResizeWidth=""271"" Anchor=""Right"">
<DockableContent Name=""content4"" AutoHide=""false"" />
</DockablePane>
</ResizingPanel>
<Hidden />
<Windows />
</DockingManager>")]
public string AvalonDockLayout {
get {
return ((string)(this["AvalonDockLayout"]));
}
set {
this["AvalonDockLayout"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Collections.Specialized.StringCollection RecentFiles {
get {
return ((global::System.Collections.Specialized.StringCollection)(this["RecentFiles"]));
}
set {
this["RecentFiles"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute(@"<?xml version=""1.0"" encoding=""utf-16""?>
<ArrayOfString xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<string>%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll</string>
</ArrayOfString>")]
public global::System.Collections.Specialized.StringCollection AssemblyList {
get {
return ((global::System.Collections.Specialized.StringCollection)(this["AssemblyList"]));
}
set {
this["AssemblyList"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Maximized")]
public global::System.Windows.WindowState MainWindowState {
get {
return ((global::System.Windows.WindowState)(this["MainWindowState"]));
}
set {
this["MainWindowState"] = value;
}
}
}
}

46
samples/XamlDesigner/Properties/Settings.settings

@ -1,46 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="ICSharpCode.XamlDesigner.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="MainWindowRect" Type="System.Windows.Rect" Scope="User">
<Value Profile="(Default)">0,0,0,0</Value>
</Setting>
<Setting Name="AvalonDockLayout" Type="System.String" Scope="User">
<Value Profile="(Default)">&lt;DockingManager&gt;
&lt;ResizingPanel Orientation="Horizontal"&gt;
&lt;ResizingPanel ResizeWidth="200" Orientation="Vertical"&gt;
&lt;DockablePane ResizeHeight="441.36166666666668" Anchor="Left"&gt;
&lt;DockableContent Name="content1" AutoHide="false" /&gt;
&lt;/DockablePane&gt;
&lt;DockablePane ResizeWidth="200" Anchor="Left"&gt;
&lt;DockableContent Name="content2" AutoHide="false" /&gt;
&lt;/DockablePane&gt;
&lt;/ResizingPanel&gt;
&lt;ResizingPanel Orientation="Vertical"&gt;
&lt;DocumentPanePlaceHolder /&gt;
&lt;DockablePane ResizeHeight="138" Anchor="Bottom"&gt;
&lt;DockableContent Name="content3" AutoHide="false" /&gt;
&lt;/DockablePane&gt;
&lt;/ResizingPanel&gt;
&lt;DockablePane ResizeWidth="271" Anchor="Right"&gt;
&lt;DockableContent Name="content4" AutoHide="false" /&gt;
&lt;/DockablePane&gt;
&lt;/ResizingPanel&gt;
&lt;Hidden /&gt;
&lt;Windows /&gt;
&lt;/DockingManager&gt;</Value>
</Setting>
<Setting Name="RecentFiles" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="AssemblyList" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;string&gt;%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll&lt;/string&gt;
&lt;/ArrayOfString&gt;</Value>
</Setting>
<Setting Name="MainWindowState" Type="System.Windows.WindowState" Scope="User">
<Value Profile="(Default)">Maximized</Value>
</Setting>
</Settings>
</SettingsFile>

29
samples/XamlDesigner/Properties/app.manifest

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
</dependentAssembly>
</dependency>
</asmv1:assembly>

45
samples/XamlDesigner/Shell.cs

@ -5,14 +5,12 @@ using System.Text;
using System.ComponentModel; using System.ComponentModel;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using ICSharpCode.WpfDesign.Designer.PropertyGrid; using ICSharpCode.WpfDesign.Designer.PropertyGrid;
using ICSharpCode.XamlDesigner.Properties; using ICSharpCode.XamlDesigner.Configuration;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.IO; using System.IO;
using System.Windows; using System.Windows;
using System.Diagnostics; using System.Diagnostics;
using ICSharpCode.WpfDesign.Designer.Services; using ICSharpCode.WpfDesign.Designer.Services;
using ICSharpCode.Xaml;
using ICSharpCode.WpfDesign.Designer.XamlBackend;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.XamlDesigner
{ {
@ -39,44 +37,21 @@ namespace ICSharpCode.XamlDesigner
public ObservableCollection<string> RecentFiles { get; private set; } public ObservableCollection<string> RecentFiles { get; private set; }
public Dictionary<object, FrameworkElement> Views { get; private set; } public Dictionary<object, FrameworkElement> Views { get; private set; }
XamlProject project = new DefaultWpfProject();
public XamlProject Project
{
get { return project; }
}
Document currentDocument; Document currentDocument;
public Document CurrentDocument public Document CurrentDocument {
{ get {
get
{
return currentDocument; return currentDocument;
} }
set set {
{
currentDocument = value; currentDocument = value;
RaisePropertyChanged("CurrentDocument"); RaisePropertyChanged("CurrentDocument");
RaisePropertyChanged("Title"); RaisePropertyChanged("Title");
} }
} }
public DocumentView CurrentDocumentView public string Title {
{ get {
get
{
if (CurrentDocument != null) {
return Views[CurrentDocument] as DocumentView;
}
return null;
}
}
public string Title
{
get
{
if (CurrentDocument != null) { if (CurrentDocument != null) {
return CurrentDocument.Title + " - " + ApplicationTitle; return CurrentDocument.Title + " - " + ApplicationTitle;
} }
@ -109,7 +84,7 @@ namespace ICSharpCode.XamlDesigner
MessageBox.Show(x.ToString()); MessageBox.Show(x.ToString());
} }
public void JumpToError(XamlDocumentError error) public void JumpToError(XamlError error)
{ {
if (CurrentDocument != null) { if (CurrentDocument != null) {
(Views[CurrentDocument] as DocumentView).JumpToError(error); (Views[CurrentDocument] as DocumentView).JumpToError(error);
@ -128,10 +103,8 @@ namespace ICSharpCode.XamlDesigner
#region Files #region Files
bool IsSomethingDirty bool IsSomethingDirty {
{ get {
get
{
foreach (var doc in Shell.Instance.Documents) { foreach (var doc in Shell.Instance.Documents) {
if (doc.IsDirty) return true; if (doc.IsDirty) return true;
} }

10
samples/XamlDesigner/TestFiles/grid.xaml

@ -1,10 +0,0 @@
<Window xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="524"
Height="385">
<ContentControl.Content>
<Grid>
<Panel.Children />
</Grid>
</ContentControl.Content>
</Window>

5
samples/XamlDesigner/Toolbox.cs

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Reflection; using System.Reflection;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using ICSharpCode.XamlDesigner.Properties; using ICSharpCode.XamlDesigner.Configuration;
using System.Windows; using System.Windows;
using System.Collections.Specialized; using System.Collections.Specialized;
using ICSharpCode.WpfDesign; using ICSharpCode.WpfDesign;
@ -52,15 +52,12 @@ namespace ICSharpCode.XamlDesigner
} }
Settings.Default.AssemblyList.Add(path); Settings.Default.AssemblyList.Add(path);
} }
Shell.Instance.Project.AddReference(assembly);
} }
public void Remove(AssemblyNode node) public void Remove(AssemblyNode node)
{ {
AssemblyNodes.Remove(node); AssemblyNodes.Remove(node);
Settings.Default.AssemblyList.Remove(node.Path); Settings.Default.AssemblyList.Remove(node.Path);
Shell.Instance.Project.RemoveReference(node.Assembly);
} }
public void LoadSettings() public void LoadSettings()

26
samples/XamlDesigner/ToolboxTreeView.cs

@ -1,26 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICSharpCode.WpfDesign.Designer.OutlineView;
namespace ICSharpCode.XamlDesigner
{
class ToolboxTreeView : DragTreeView
{
protected override bool CanInsert(DragTreeViewItem target, DragTreeViewItem[] items, DragTreeViewItem after, bool copy)
{
return base.CanInsert(target, items, after, copy);
}
protected override void Insert(DragTreeViewItem target, DragTreeViewItem[] items, DragTreeViewItem after, bool copy)
{
base.Insert(target, items, after, copy);
}
protected override void Remove(DragTreeViewItem target, DragTreeViewItem item)
{
base.Remove(target, item);
}
}
}

65
samples/XamlDesigner/XamlDesigner.csproj

@ -13,7 +13,7 @@
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest> <ApplicationManifest>Configuration\app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -79,47 +79,60 @@
<DependentUpon>App.xaml</DependentUpon> <DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<ProjectReference Include="..\..\src\AddIns\DisplayBindings\WpfDesign\WpfDesign.Designer\Project\WpfDesign.Designer.csproj">
<Project>{78CC29AC-CC79-4355-B1F2-97936DF198AC}</Project>
<Name>WpfDesign.Designer</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\AddIns\DisplayBindings\WpfDesign\WpfDesign.XamlDom\Project\WpfDesign.XamlDom.csproj">
<Project>{88DA149F-21B2-48AB-82C4-28FB6BDFD783}</Project>
<Name>WpfDesign.XamlDom</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\AddIns\DisplayBindings\WpfDesign\WpfDesign\Project\WpfDesign.csproj">
<Project>{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}</Project>
<Name>WpfDesign</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\src\Main\GlobalAssemblyInfo.cs"> <Compile Include="..\..\src\Main\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link> <Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile> </Compile>
<Compile Include="BitmapButton.xaml.cs"> <Compile Include="BitmapButton.xaml.cs">
<DependentUpon>BitmapButton.xaml</DependentUpon> <DependentUpon>BitmapButton.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Configuration\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Configuration\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Converters.cs" /> <Compile Include="Converters.cs" />
<Compile Include="Document.cs" /> <Compile Include="Document.cs" />
<Compile Include="DocumentView.xaml.cs"> <Compile Include="DocumentView.xaml.cs">
<DependentUpon>DocumentView.xaml</DependentUpon> <DependentUpon>DocumentView.xaml</DependentUpon>
<SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="ErrorListView.xaml.cs"> <Compile Include="ErrorListView.xaml.cs">
<DependentUpon>ErrorListView.xaml</DependentUpon> <DependentUpon>ErrorListView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="ExtensionMethods.cs" /> <Compile Include="ExtensionMethods.cs" />
<Compile Include="MainWindow_Commands.cs" /> <Compile Include="MainWindow_Commands.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Shell.cs" /> <Compile Include="Shell.cs" />
<Compile Include="MainWindow.xaml.cs"> <Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon> <DependentUpon>MainWindow.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="SimpleCommand.cs" /> <Compile Include="SimpleCommand.cs" />
<Compile Include="Toolbox.cs" />
<Compile Include="ToolboxView.xaml.cs">
<DependentUpon>ToolboxView.xaml</DependentUpon>
</Compile>
<Compile Include="XamlFormatter.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="NewFileTemplate.xaml"> <None Include="NewFileTemplate.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<None Include="..\..\data\options\WpfToolbox.xaml">
<Link>WpfToolbox.xaml</Link>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Page Include="BitmapButton.xaml"> <Page Include="BitmapButton.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@ -152,11 +165,15 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="ToolboxView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="Configuration\app.config" />
<None Include="Properties\app.manifest" /> <None Include="Configuration\app.manifest" />
<None Include="Properties\Settings.settings"> <None Include="Configuration\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
@ -168,20 +185,6 @@
<ItemGroup> <ItemGroup>
<Resource Include="Images\Error.png" /> <Resource Include="Images\Error.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\AddIns\BackendBindings\Xaml\Xaml\Xaml.csproj">
<Project>{B4E5C965-7BB9-4AE9-85FB-C47480B879AD}</Project>
<Name>Xaml</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\AddIns\DisplayBindings\WpfDesign\WpfDesign.Designer\WpfDesign.Designer.csproj">
<Project>{78CC29AC-CC79-4355-B1F2-97936DF198AC}</Project>
<Name>WpfDesign.Designer</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\AddIns\DisplayBindings\WpfDesign\WpfDesign\WpfDesign.csproj">
<Project>{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}</Project>
<Name>WpfDesign</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

25
samples/XamlDesigner/XamlDesigner.sln

@ -1,8 +1,17 @@
 
Microsoft Visual Studio Solution File, Format Version 10.00 Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008 # Visual Studio 2008
# SharpDevelop 3.1.0.4545
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlDesigner", "XamlDesigner.csproj", "{27DA2B5C-2AAA-4478-AB00-3E184273C241}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlDesigner", "XamlDesigner.csproj", "{27DA2B5C-2AAA-4478-AB00-3E184273C241}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign", "..\..\src\AddIns\DisplayBindings\WpfDesign\WpfDesign\Project\WpfDesign.csproj", "{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.Designer", "..\..\src\AddIns\DisplayBindings\WpfDesign\WpfDesign.Designer\Project\WpfDesign.Designer.csproj", "{78CC29AC-CC79-4355-B1F2-97936DF198AC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.Tests", "..\..\src\AddIns\DisplayBindings\WpfDesign\WpfDesign.Designer\Tests\WpfDesign.Tests.csproj", "{943DBBB3-E84E-4CF4-917C-C05AFA8743C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.XamlDom", "..\..\src\AddIns\DisplayBindings\WpfDesign\WpfDesign.XamlDom\Project\WpfDesign.XamlDom.csproj", "{88DA149F-21B2-48AB-82C4-28FB6BDFD783}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -13,6 +22,22 @@ Global
{27DA2B5C-2AAA-4478-AB00-3E184273C241}.Debug|Any CPU.Build.0 = Debug|Any CPU {27DA2B5C-2AAA-4478-AB00-3E184273C241}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27DA2B5C-2AAA-4478-AB00-3E184273C241}.Release|Any CPU.ActiveCfg = Release|Any CPU {27DA2B5C-2AAA-4478-AB00-3E184273C241}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27DA2B5C-2AAA-4478-AB00-3E184273C241}.Release|Any CPU.Build.0 = Release|Any CPU {27DA2B5C-2AAA-4478-AB00-3E184273C241}.Release|Any CPU.Build.0 = Release|Any CPU
{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}.Release|Any CPU.Build.0 = Release|Any CPU
{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78CC29AC-CC79-4355-B1F2-97936DF198AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78CC29AC-CC79-4355-B1F2-97936DF198AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78CC29AC-CC79-4355-B1F2-97936DF198AC}.Release|Any CPU.Build.0 = Release|Any CPU
{78CC29AC-CC79-4355-B1F2-97936DF198AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{943DBBB3-E84E-4CF4-917C-C05AFA8743C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{943DBBB3-E84E-4CF4-917C-C05AFA8743C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{943DBBB3-E84E-4CF4-917C-C05AFA8743C1}.Release|Any CPU.Build.0 = Release|Any CPU
{943DBBB3-E84E-4CF4-917C-C05AFA8743C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88DA149F-21B2-48AB-82C4-28FB6BDFD783}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88DA149F-21B2-48AB-82C4-28FB6BDFD783}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88DA149F-21B2-48AB-82C4-28FB6BDFD783}.Release|Any CPU.Build.0 = Release|Any CPU
{88DA149F-21B2-48AB-82C4-28FB6BDFD783}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

51
samples/XamlDesigner/app.config

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="ICSharpCode.XamlDesigner.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<ICSharpCode.XamlDesigner.Properties.Settings>
<setting name="MainWindowRect" serializeAs="String">
<value>0,0,0,0</value>
</setting>
<setting name="AvalonDockLayout" serializeAs="String">
<value>&lt;DockingManager&gt;
&lt;ResizingPanel Orientation="Horizontal"&gt;
&lt;ResizingPanel ResizeWidth="200" Orientation="Vertical"&gt;
&lt;DockablePane ResizeHeight="441.36166666666668" Anchor="Left"&gt;
&lt;DockableContent Name="content1" AutoHide="false" /&gt;
&lt;/DockablePane&gt;
&lt;DockablePane ResizeWidth="200" Anchor="Left"&gt;
&lt;DockableContent Name="content2" AutoHide="false" /&gt;
&lt;/DockablePane&gt;
&lt;/ResizingPanel&gt;
&lt;ResizingPanel Orientation="Vertical"&gt;
&lt;DocumentPanePlaceHolder /&gt;
&lt;DockablePane ResizeHeight="138" Anchor="Bottom"&gt;
&lt;DockableContent Name="content3" AutoHide="false" /&gt;
&lt;/DockablePane&gt;
&lt;/ResizingPanel&gt;
&lt;DockablePane ResizeWidth="271" Anchor="Right"&gt;
&lt;DockableContent Name="content4" AutoHide="false" /&gt;
&lt;/DockablePane&gt;
&lt;/ResizingPanel&gt;
&lt;Hidden /&gt;
&lt;Windows /&gt;
&lt;/DockingManager&gt;</value>
</setting>
<setting name="AssemblyList" serializeAs="Xml">
<value>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll</string>
</ArrayOfString>
</value>
</setting>
<setting name="MainWindowState" serializeAs="String">
<value>Maximized</value>
</setting>
</ICSharpCode.XamlDesigner.Properties.Settings>
</userSettings>
</configuration>
Loading…
Cancel
Save