How to declared DataGrid with generic parameter in XAML

BitSmithy 2,141 Reputation points
2021-02-05T16:38:49.38+00:00

Hello,

I want to extend DataGrid (from UWP Toolkit).

I tried in user class do such definition

public class MyDataGrid<T> : DataGrid
{
...
}

but it probably isnt the right way, because XAML doesnt see such extended DataGrid.

How to extends DataGrid, but extended class should have generic parameter <T>? Is it possible?

Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. Ivanich 306 Reputation points
    2021-02-06T11:42:37.33+00:00

    Perhaps, your new derived class is defined in the namespace that is not referenced in XAML. Add clr-namespace directive to make your new control visible.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.