Can add / remove variable exports in list
This commit is contained in:
parent
7335f9bdb8
commit
292f0785c6
@ -32,6 +32,11 @@ namespace rabi_splitter_WPF
|
|||||||
_variableExportSettings.Add(ves);
|
_variableExportSettings.Add(ves);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void Delete(VariableExportSetting ves)
|
||||||
|
{
|
||||||
|
_variableExportSettings.Remove(ves);
|
||||||
|
}
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
[NotifyPropertyChangedInvocator]
|
[NotifyPropertyChangedInvocator]
|
||||||
|
@ -75,6 +75,11 @@ namespace rabi_splitter_WPF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void DefaultButton_Click()
|
||||||
|
{
|
||||||
|
OutputFormat = "DEFAULT OUTPUT FORMAT: " + OutputFileName;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public VariableExportSetting()
|
public VariableExportSetting()
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:rabi_splitter_WPF"
|
xmlns:local="clr-namespace:rabi_splitter_WPF"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="500" d:DesignWidth="900">
|
d:DesignHeight="500" d:DesignWidth="540">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<Button Content="Add" Width="40" Height="40" DockPanel.Dock="Right" Click="AddButton_Click"/>
|
<Button Content="Add" Width="40" Height="40" DockPanel.Dock="Right" Click="AddButton_Click"/>
|
||||||
@ -13,23 +13,30 @@
|
|||||||
<ListBox Name="VariableExportListBox" ItemsSource="{Binding VariableExportSettings}">
|
<ListBox Name="VariableExportListBox" ItemsSource="{Binding VariableExportSettings}">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid Name="MainPanel" Height="80" Width="500" DockPanel.Dock="Top">
|
<Grid Name="MainPanel" Height="80" Width="500" DockPanel.Dock="Top" Margin="5,0,5,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="4*" />
|
||||||
|
<ColumnDefinition Width="6*" />
|
||||||
<ColumnDefinition Width="2*" />
|
<ColumnDefinition Width="2*" />
|
||||||
<ColumnDefinition Width="3*" />
|
|
||||||
<ColumnDefinition Width="1*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel Grid.Column="0">
|
<StackPanel Grid.Column="0">
|
||||||
<TextBlock Text="Variable"/>
|
<TextBlock Text="Variable"/>
|
||||||
<ComboBox ItemsSource="{Binding Path=VariableCaptions}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding Path=SelectedVariable, Mode=TwoWay}"/>
|
<ComboBox ItemsSource="{Binding Path=VariableCaptions}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding Path=SelectedVariable, Mode=TwoWay}"/>
|
||||||
<TextBlock Text="Output File"/>
|
<TextBlock Text="Output File" Margin="0,2,0,0"/>
|
||||||
<TextBox Text="{Binding Path=OutputFileName, Mode=TwoWay}"/>
|
<TextBox Text="{Binding Path=OutputFileName, Mode=TwoWay}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<DockPanel Grid.Column="1">
|
<DockPanel Grid.Column="1" Margin="15,0,15,0">
|
||||||
<TextBox Text="{Binding Path=OutputFormat, Mode=TwoWay}" AcceptsReturn="True"/>
|
<DockPanel>
|
||||||
|
<DockPanel DockPanel.Dock="Top">
|
||||||
|
<TextBlock DockPanel.Dock="Left" Text="Format"/>
|
||||||
|
<Button DockPanel.Dock="Right" Content="Default Format" Click="DefaultButton_Click" Width="120" HorizontalAlignment="Right"/>
|
||||||
|
</DockPanel>
|
||||||
|
<TextBox Margin="0,5,0,5" Text="{Binding Path=OutputFormat, Mode=TwoWay}" AcceptsReturn="True"/>
|
||||||
|
</DockPanel>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
<DockPanel Grid.Column="2">
|
<DockPanel Grid.Column="2">
|
||||||
<ToggleButton Content="Export" DockPanel.Dock="Bottom" IsChecked="{Binding Path=IsExporting, Mode=TwoWay}"/>
|
<Button Content="X" DockPanel.Dock="Top" Width="20" HorizontalAlignment="Right" Click="CloseButton_Click"/>
|
||||||
|
<ToggleButton Margin="5,5,5,5" Content="Export" DockPanel.Dock="Bottom" IsChecked="{Binding Path=IsExporting, Mode=TwoWay}"/>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
@ -42,5 +42,18 @@ namespace rabi_splitter_WPF
|
|||||||
variableExportContext.Add(ves);
|
variableExportContext.Add(ves);
|
||||||
VariableExportListBox.Items.Refresh();
|
VariableExportListBox.Items.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var variableExportSetting = (sender as Button).DataContext as VariableExportSetting;
|
||||||
|
variableExportContext.Delete(variableExportSetting);
|
||||||
|
VariableExportListBox.Items.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DefaultButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var variableExportSetting = (sender as Button).DataContext as VariableExportSetting;
|
||||||
|
variableExportSetting.DefaultButton_Click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user