Backoffice fun
This commit is contained in:
@@ -8,9 +8,9 @@
|
|||||||
d:DesignHeight="450" d:DesignWidth="800"
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
Padding="10">
|
Padding="10">
|
||||||
|
|
||||||
<StackPanel>
|
<StackPanel x:Name="ContentPanel">
|
||||||
<TextBlock>Metafield Groups:</TextBlock>
|
<TextBlock>Metafield Groups:</TextBlock>
|
||||||
<CheckBox Content="Fitment" />
|
<CheckBox x:Name="Fitment" Content="Fitment" />
|
||||||
<CheckBox Content="Product Feed" />
|
<CheckBox x:Name="ProductFeed" Content="Product Feed" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -18,6 +18,30 @@ namespace PartSource.Backoffice.Components
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class TaskSetup : UserControl
|
public partial class TaskSetup : UserControl
|
||||||
{
|
{
|
||||||
|
public IList<string> SelectedTasks
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
IList<string> selectedTasks = new List<string>();
|
||||||
|
|
||||||
|
foreach (object control in ContentPanel.Children)
|
||||||
|
{
|
||||||
|
switch (control)
|
||||||
|
{
|
||||||
|
case CheckBox checkbox:
|
||||||
|
if (checkbox.IsChecked.GetValueOrDefault())
|
||||||
|
{
|
||||||
|
selectedTasks.Add(checkbox.Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return selectedTasks;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public TaskSetup()
|
public TaskSetup()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<Components:TaskSetup />
|
<Components:TaskSetup x:Name="TaskSetup" />
|
||||||
<Components:ProgressDisplay />
|
<Components:ProgressDisplay />
|
||||||
<Button x:Name="Update" Content="Start" HorizontalAlignment="left" Click="Update_Click" />
|
<Button x:Name="Update" Content="Start" HorizontalAlignment="left" Click="Update_Click" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -27,7 +27,15 @@ namespace PartSource.Backoffice
|
|||||||
|
|
||||||
private void Update_Click(object sender, RoutedEventArgs e)
|
private void Update_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (TaskSetup.SelectedTasks.Count > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Select one or more metafield groups to continue.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user