Browse Source

Replace ProjectOptionPanel.HideHeader() with ProjectOptionPanel.HeaderVisibility property.

pull/30/head
Daniel Grunwald 14 years ago
parent
commit
250a077b93
  1. 9
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/LinkerOptions.xaml.cs
  2. 8
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/PreprocessorOptions.xaml.cs
  3. 18
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ProjectOptionPanel.cs
  4. 4
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ProjectOptionPanel.xaml

9
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/LinkerOptions.xaml.cs

@ -26,6 +26,7 @@ namespace ICSharpCode.CppBinding.Project @@ -26,6 +26,7 @@ namespace ICSharpCode.CppBinding.Project
public LinkerOptions()
{
this.HeaderVisibility = Visibility.Collapsed;
InitializeComponent();
}
@ -76,14 +77,6 @@ namespace ICSharpCode.CppBinding.Project @@ -76,14 +77,6 @@ namespace ICSharpCode.CppBinding.Project
IsDirty = false;
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
HideHeader();
}
protected override bool Save(MSBuildBasedProject project, string configuration, string platform)
{
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project,

8
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/PreprocessorOptions.xaml.cs

@ -27,6 +27,7 @@ namespace ICSharpCode.CppBinding.Project @@ -27,6 +27,7 @@ namespace ICSharpCode.CppBinding.Project
public PreprocessorOptions()
{
InitializeComponent();
this.HeaderVisibility = Visibility.Collapsed;
}
#region Properties
@ -72,13 +73,6 @@ namespace ICSharpCode.CppBinding.Project @@ -72,13 +73,6 @@ namespace ICSharpCode.CppBinding.Project
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
HideHeader();
}
protected override bool Save(MSBuildBasedProject project, string configuration, string platform)
{
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project,

18
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ProjectOptionPanel.cs

@ -54,9 +54,6 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -54,9 +54,6 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
bool resettingIndex;
bool isLoaded;
StackPanel configStackPanel;
Line headerline;
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected virtual void Load(MSBuildBasedProject project, string configuration, string platform)
@ -75,21 +72,20 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -75,21 +72,20 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
}
public void HideHeader ()
{
configStackPanel.Visibility = Visibility.Hidden;
headerline.Visibility = Visibility.Hidden;
}
public static readonly DependencyProperty HeaderVisibilityProperty =
DependencyProperty.Register("HeaderVisibility", typeof(Visibility), typeof(ProjectOptionPanel),
new FrameworkPropertyMetadata(Visibility.Visible));
public Visibility HeaderVisibility {
get { return (Visibility)GetValue(HeaderVisibilityProperty); }
set { SetValue(HeaderVisibilityProperty, value); }
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
configurationComboBox = Template.FindName("PART_configuration", this) as ComboBox;
platformComboBox = Template.FindName("PART_platform", this) as ComboBox;
headerline = Template.FindName("PART_headerline", this) as Line;
configStackPanel = Template.FindName("PART_stackpanel", this) as StackPanel;
}

4
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ProjectOptionPanel.xaml

@ -11,13 +11,13 @@ @@ -11,13 +11,13 @@
Background="{TemplateBinding Panel.Background}"
SnapsToDevicePixels="True">
<DockPanel>
<StackPanel x:Name="PART_stackpanel" DockPanel.Dock="Top" Orientation="Horizontal">
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Visibility="{TemplateBinding HeaderVisibility}">
<Label Content="{core:StringParse ${res:Dialog.ProjectOptions.Configuration}:}" Target="{Binding ElementName=PART_configuration}" />
<ComboBox Name="PART_configuration" Width="120" VerticalAlignment="Center" />
<Label Content="{core:StringParse ${res:Dialog.ProjectOptions.Platform}:}" Target="{Binding ElementName=PART_platform}" />
<ComboBox Name="PART_platform" Width="120" VerticalAlignment="Center"/>
</StackPanel>
<Line x:Name="PART_headerline" X1="0" X2="1" Margin="0,4" StrokeThickness="3" Stroke="Gray" DockPanel.Dock="Top" Stretch="Fill"/>
<Line X1="0" X2="1" Margin="0,4" StrokeThickness="3" Stroke="Gray" DockPanel.Dock="Top" Stretch="Fill" Visibility="{TemplateBinding HeaderVisibility}"/>
<ContentPresenter Content="{TemplateBinding ContentControl.Content}"
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"

Loading…
Cancel
Save