XAML and WPF - Passing Variables to XAML Windows

前端 未结 4 1090
难免孤独
难免孤独 2021-01-01 01:22

I\'m pretty new to WPF and i\'m trying to load a XAML window and pass a variable to this XAML in its constructor or so, because i need it to load some items from this passed

4条回答
  •  不知归路
    2021-01-01 01:59

    Typically, in WPF, you'd create the items you want to load, and set the Window (or UserControl)'s DataContext to the class that contains your items. You can then bind directly to these in order to do custom display from the XAML.

提交回复
热议问题