Skip to content

Commit

Permalink
efuse view
Browse files Browse the repository at this point in the history
  • Loading branch information
buldo committed May 24, 2024
1 parent 8cbe6e5 commit 3fa258a
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 39 deletions.
86 changes: 47 additions & 39 deletions src/EfuseManager/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
xmlns:local="clr-namespace:EfuseManager"
xmlns:viewModels="clr-namespace:EfuseManager.ViewModels"
xmlns:md="https://github.com/fantasticfiasco/mvvm-dialogs"
xmlns:views="clr-namespace:EfuseManager.Views"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance viewModels:MainViewModel}"
md:DialogServiceViews.IsRegistered="True"
Expand All @@ -16,44 +17,51 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="0,0,2, 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button
Grid.Column="0"
Margin="2,0,0,0"
Command="{Binding RefreshCommand}">Refresh</Button>
<ComboBox
Grid.Column="1"
Margin="2,0,0,0"
ItemsSource="{Binding Devices}"
IsEditable="False"
IsReadOnly="True"
DisplayMemberPath="DeviceName"
SelectedItem="{Binding SelectedDevice}"></ComboBox>
<Button
Grid.Column="2"
Margin="2, 0, 0, 0"
Command="{Binding ReadCommand}">Read</Button>
<Button
Grid.Column="3"
Margin="2, 0, 0, 0"
Command="{Binding WriteCommand}">Write</Button>
</Grid>
<StackPanel
Grid.Row="1"
Orientation="Horizontal"
Margin="0,2,2,0">
<Button
Margin="2,0,0,0"
Command="{Binding ReadFileCommand}">Read file</Button>
<Button
Margin="2,0,0,0"
Command="{Binding WriteFileCommand}">Write file</Button>
</StackPanel>
<GroupBox Grid.Row="0" Header="Device">
<Grid Margin="0, 2, 0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button
Grid.Column="0"
Margin="0,0,0,0"
Command="{Binding RefreshCommand}">Refresh</Button>
<ComboBox
Grid.Column="1"
Margin="2,0,0,0"
ItemsSource="{Binding Devices}"
IsEditable="False"
IsReadOnly="True"
DisplayMemberPath="DeviceName"
SelectedItem="{Binding SelectedDevice}"></ComboBox>
<Button
Grid.Column="2"
Margin="2, 0, 0, 0"
Command="{Binding ReadCommand}">Read</Button>
<Button
Grid.Column="3"
Margin="2, 0, 0, 0"
Command="{Binding WriteCommand}">Write</Button>
</Grid>
</GroupBox>
<GroupBox Grid.Row="1" Header="File">
<StackPanel
Orientation="Horizontal"
Margin="0,2,0,2">
<Button
Margin="0,0,0,0"
Command="{Binding ReadFileCommand}">Read file</Button>
<Button
Margin="2,0,0,0"
Command="{Binding WriteFileCommand}">Write file</Button>
</StackPanel>

</GroupBox>
<views:EfuseView
Grid.Row="2"
DataContext="{Binding EfuseMap}"/>
</Grid>
</Window>
18 changes: 18 additions & 0 deletions src/EfuseManager/Views/EfuseView.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<UserControl x:Class="EfuseManager.Views.EfuseView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:EfuseManager.Views"
xmlns:viewModels="clr-namespace:EfuseManager.ViewModels"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance viewModels:EfuseMapViewModel}"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>

</Grid>
</UserControl>
28 changes: 28 additions & 0 deletions src/EfuseManager/Views/EfuseView.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace EfuseManager.Views
{
/// <summary>
/// Interaction logic for EfuseView.xaml
/// </summary>
public partial class EfuseView : UserControl
{
public EfuseView()
{
InitializeComponent();
}
}
}

0 comments on commit 3fa258a

Please sign in to comment.