|
1 | 1 | using CommunityToolkit.WinUI; |
2 | | -using Microsoft.UI; |
3 | 2 | using Microsoft.UI.Xaml; |
4 | 3 | using Microsoft.UI.Xaml.Controls; |
5 | 4 | using Microsoft.UI.Xaml.Controls.Primitives; |
|
8 | 7 | using System; |
9 | 8 | using System.Collections; |
10 | 9 | using System.Collections.Generic; |
| 10 | +using System.ComponentModel; |
11 | 11 | using System.ComponentModel.DataAnnotations; |
12 | 12 | using System.IO; |
13 | 13 | using System.Linq; |
|
19 | 19 | using Windows.Storage; |
20 | 20 | using Windows.Storage.Pickers; |
21 | 21 | using Windows.System; |
22 | | -using WinRT.Interop; |
23 | 22 | using WinUI.TableView.Extensions; |
24 | 23 | using WinUI.TableView.Helpers; |
25 | 24 |
|
@@ -49,10 +48,14 @@ public TableView() |
49 | 48 |
|
50 | 49 | Columns = new TableViewColumnsCollection(this); |
51 | 50 | FilterHandler = new ColumnFilterHandler(this); |
| 51 | + |
52 | 52 | base.ItemsSource = _collectionView; |
53 | 53 | base.SelectionMode = SelectionMode; |
| 54 | + |
| 55 | + SetValue(ConditionalCellStylesProperty, new TableViewConditionalCellStylesCollection()); |
54 | 56 | RegisterPropertyChangedCallback(ItemsControl.ItemsSourceProperty, OnBaseItemsSourceChanged); |
55 | 57 | RegisterPropertyChangedCallback(ListViewBase.SelectionModeProperty, OnBaseSelectionModeChanged); |
| 58 | + |
56 | 59 | Loaded += OnLoaded; |
57 | 60 | SelectionChanged += TableView_SelectionChanged; |
58 | 61 | _collectionView.ItemPropertyChanged += OnItemPropertyChanged; |
@@ -88,7 +91,7 @@ private void TableView_SelectionChanged(object sender, SelectionChangedEventArgs |
88 | 91 | /// <summary> |
89 | 92 | /// Handles the PropertyChanged event of an item in the TableView. |
90 | 93 | /// </summary> |
91 | | - private void OnItemPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) |
| 94 | + private void OnItemPropertyChanged(object? sender, PropertyChangedEventArgs e) |
92 | 95 | { |
93 | 96 | var row = ContainerFromItem(sender) as TableViewRow; |
94 | 97 |
|
@@ -747,8 +750,8 @@ private async Task<StorageFile> GetStorageFile() |
747 | 750 | var savePicker = new FileSavePicker(); |
748 | 751 | savePicker.FileTypeChoices.Add("CSV (Comma delimited)", [".csv"]); |
749 | 752 | #if WINDOWS |
750 | | - var hWnd = Win32Interop.GetWindowFromWindowId(XamlRoot.ContentIslandEnvironment.AppWindowId); |
751 | | - InitializeWithWindow.Initialize(savePicker, hWnd); |
| 753 | + var hWnd = Microsoft.UI.Win32Interop.GetWindowFromWindowId(XamlRoot.ContentIslandEnvironment.AppWindowId); |
| 754 | + WinRT.Interop.InitializeWithWindow.Initialize(savePicker, hWnd); |
752 | 755 | #endif |
753 | 756 |
|
754 | 757 | return await savePicker.PickSaveFileAsync(); |
|
0 commit comments