diff --git a/source/RevitLookup/Views/Dialogs/FamilySizeTableEditDialog.xaml b/source/RevitLookup/Views/Dialogs/FamilySizeTableEditDialog.xaml index 1b3618d0..2d4aeb00 100644 --- a/source/RevitLookup/Views/Dialogs/FamilySizeTableEditDialog.xaml +++ b/source/RevitLookup/Views/Dialogs/FamilySizeTableEditDialog.xaml @@ -6,20 +6,32 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dialogs="clr-namespace:RevitLookup.ViewModels.Dialogs" xmlns:markup="clr-namespace:RevitLookup.Views.Markup" + xmlns:rl="http://revitlookup.com/xaml" mc:Ignorable="d" d:DataContext="{d:DesignInstance dialogs:FamilySizeTableEditDialogViewModel}"> + + ItemsSource="{Binding}"> + + + + + \ No newline at end of file diff --git a/source/RevitLookup/Views/Dialogs/FamilySizeTableEditDialog.xaml.cs b/source/RevitLookup/Views/Dialogs/FamilySizeTableEditDialog.xaml.cs index 461e8f8b..794fd151 100644 --- a/source/RevitLookup/Views/Dialogs/FamilySizeTableEditDialog.xaml.cs +++ b/source/RevitLookup/Views/Dialogs/FamilySizeTableEditDialog.xaml.cs @@ -35,7 +35,7 @@ public sealed partial class FamilySizeTableEditDialog private readonly FamilySizeTableEditDialogViewModel _viewModel; private readonly bool _isEditable; - public FamilySizeTableEditDialog(IServiceProvider serviceProvider, Document document,FamilySizeTableManager manager, string tableName) + public FamilySizeTableEditDialog(IServiceProvider serviceProvider, Document document, FamilySizeTableManager manager, string tableName) { _isEditable = true; _serviceProvider = serviceProvider; @@ -43,8 +43,6 @@ public FamilySizeTableEditDialog(IServiceProvider serviceProvider, Document docu DataContext = _viewModel; InitializeComponent(); - - SizeTable.LoadingRow += OnGridRowLoading; } public FamilySizeTableEditDialog(IServiceProvider serviceProvider, Document document, FamilySizeTable table) @@ -77,20 +75,14 @@ public async Task ShowAsync() _viewModel.SaveData(); } } - - private void OnGridRowLoading(object sender, DataGridRowEventArgs args) - { - var row = args.Row; - row.Loaded += OnGridRowLoaded; - } - - private void OnGridRowLoaded(object sender, RoutedEventArgs args) + + private void OnRightClick(object sender, RoutedEventArgs routedEventArgs) { var element = (FrameworkElement) sender; var context = (DataRowView) element.DataContext; CreateGridRowContextMenu(context.Row, element); } - + private void CreateGridRowContextMenu(DataRow dataRow, FrameworkElement dataGridRow) { var contextMenu = new ContextMenu