This demo shows how to implement an UserControl using XAML and a C++ code-behind. The main focus points of this demo are:
-
Shows how to create an
UserControlwith a code-behind class in C++ that implementsDependencyPropertys andEvents. -
Shows how to use the
UseControlin another XAML.
-
NumericUpDown.h and NumericUpDown.cpp: Implements a code-behind for NumericUpDown.xaml. It declares four
DependencyPropertys (Value,MaxValue,MinValueandStepValue) as well as aRoutedEvent(ValueChanged); -
MainWindow.h: Implements a minimal code-behind for MainWindow.xaml.
-
UserControlGame.cpp: Implements a minimal game module that registers the NoesisGUI native components.
NoesisBlueprint'/Game/UserControls/View.View': It's aNoesisViewforNoesisXaml'/Game/UserControls/MainWindow.MainWindow'(MainWindow.xaml).
UserControl - Level Blueprint: Creates aWidgetfromNoesisBlueprint'/Game/UserControls/View.View', adds it to the viewport and captures mouse input.
NoesisGUI Project Settings: Sets theNoesisXamlNoesisXaml'/Game/Theme/NoesisTheme_DarkBlue.NoesisTheme_DarkBlue'as the global applicationResourceDictionary.