Browse Source

Show a Icon for the WindowClone in the Designer

pull/586/head
jogibear9988 11 years ago
parent
commit
b70e847421
  1. 13
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/ControlStyles.xaml
  2. 82
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Converters.cs
  3. BIN
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/Icons.32x32.EmptyProjectIcon.png
  4. 3
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj

13
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/ControlStyles.xaml

@ -120,14 +120,11 @@ @@ -120,14 +120,11 @@
<Border Background="{DynamicResource {x:Static SystemColors.GradientActiveCaptionBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1,1,1,1">
<DockPanel Margin="4,0,4,4">
<DockPanel Height="26" DockPanel.Dock="Top">
<Image Width="16" Height="16" Margin="1,0,0,0" Source="{TemplateBinding Window.Icon}" />
<Button Name="CloseButton" VerticalAlignment="Top" Width="43" Height="17" DockPanel.Dock="Right">
<Path Fill="#FFF6F2F2" Stretch="Uniform" Margin="1" Stroke="#FF808080" Data="M160,400 L176,400 192,384 208,400 224,400 200,376 224,352 208,352 192,368 176,352 160,352 184,376 z" />
</Button>
<Button Name="MaximiseButton" VerticalAlignment="Top" Width="25" Height="17" DockPanel.Dock="Right" />
<Button Name="MinimizeButton" VerticalAlignment="Top" Width="25" Height="17" DockPanel.Dock="Right">
<!--<Rectangle Fill="#FFF6F2F2" RadiusX="0.5" RadiusY="0.5" Width="12" Height="5" Stroke="#FF808080" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>-->
</Button>
<Image Width="16" Height="16" Margin="1,0,0,0" Source="/ICSharpCode.WpfDesign.Designer;component/Images/Icons.32x32.EmptyProjectIcon.png" Visibility="{Binding Window.Icon, Converter={x:Static Converters:CollapsedWhenZero.Instance}}" />
<Image Width="16" Height="16" Margin="1,0,0,0" Source="{TemplateBinding Window.Icon}" Visibility="{Binding Window.Icon, Converter={x:Static Converters:CollapsedWhenNotNull.Instance}}" />
<Button Content="r" FontFamily="Marlett" Name="CloseButton" VerticalAlignment="Top" Width="43" Height="17" DockPanel.Dock="Right" />
<Button Content="1" FontFamily="Marlett" Name="MinimizeButton" VerticalAlignment="Top" Width="25" Height="17" DockPanel.Dock="Right" />
<Button Content="0" FontFamily="Marlett" Name="MaximiseButton" VerticalAlignment="Top" Width="25" Height="17" DockPanel.Dock="Right" />
<Label Margin="4,0,0,0" Content="{TemplateBinding Window.Title}" />
</DockPanel>
<Border Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">

82
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Converters.cs

@ -111,6 +111,26 @@ namespace ICSharpCode.WpfDesign.Designer.Converters @@ -111,6 +111,26 @@ namespace ICSharpCode.WpfDesign.Designer.Converters
}
}
public class CollapsedWhenNotNull : IValueConverter
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "converter is immutable")]
public static readonly CollapsedWhenNotNull Instance = new CollapsedWhenNotNull();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value != null)
{
return Visibility.Collapsed;
}
return Visibility.Visible;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class FalseWhenNull : IValueConverter
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "converter is immutable")]
@ -160,37 +180,37 @@ namespace ICSharpCode.WpfDesign.Designer.Converters @@ -160,37 +180,37 @@ namespace ICSharpCode.WpfDesign.Designer.Converters
}
}
public class ControlToRealWidthConverter : IMultiValueConverter
{
public static readonly ControlToRealWidthConverter Instance = new ControlToRealWidthConverter();
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
return PlacementOperation.GetRealElementSize((UIElement)values[0]).Width;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class ControlToRealHeightConverter : IMultiValueConverter
{
public static readonly ControlToRealHeightConverter Instance = new ControlToRealHeightConverter();
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
return PlacementOperation.GetRealElementSize((UIElement)values[0]).Height;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class FormatDoubleConverter : IValueConverter
public class ControlToRealWidthConverter : IMultiValueConverter
{
public static readonly ControlToRealWidthConverter Instance = new ControlToRealWidthConverter();
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
return PlacementOperation.GetRealElementSize((UIElement)values[0]).Width;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class ControlToRealHeightConverter : IMultiValueConverter
{
public static readonly ControlToRealHeightConverter Instance = new ControlToRealHeightConverter();
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
return PlacementOperation.GetRealElementSize((UIElement)values[0]).Height;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class FormatDoubleConverter : IValueConverter
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "converter is immutable")]
public static readonly FormatDoubleConverter Instance=new FormatDoubleConverter();

BIN
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/Icons.32x32.EmptyProjectIcon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 B

3
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj

@ -458,4 +458,7 @@ @@ -458,4 +458,7 @@
<ItemGroup>
<Resource Include="Images\canvas.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\Icons.32x32.EmptyProjectIcon.png" />
</ItemGroup>
</Project>
Loading…
Cancel
Save