Internal wrapper type that powers builder-style programming.
This type is usually constructed and destructed in a single declaration line, only serving to set properties on the underlying XAML element, or to add the element to a parent.
More...
#include <cppxaml/Controls.h>
Inherited by cppxaml::details::Wrapper< T, TItems >.
|
auto | Name () const |
| Returns the element's Name.
|
|
auto | Name (std::wstring_view n) const |
| Set the element's Name.
|
|
auto | Margin () const |
|
auto | Margin (cppxaml::xaml::Thickness t) const |
|
auto | Margin (double m) const |
|
auto | Margin (double left, double top, double right, double bottom) const |
|
auto | Padding () const |
|
auto | Padding (cppxaml::xaml::Thickness t) const |
|
auto | Padding (double m) const |
|
auto | Padding (double left, double top, double right, double bottom) const |
|
template<typename TValue > |
auto | Set (cppxaml::xaml::DependencyProperty dp, TValue &&value) |
| Sets a property.
|
|
auto | VisualStates (const std::unordered_map< std::wstring, cppxaml::xaml::VisualStateChangedEventHandler > &map) |
| Sets up a visual state change listeners.
|
|
template<typename T>
struct cppxaml::details::WrapperT< T >
Internal wrapper type that powers builder-style programming.
This type is usually constructed and destructed in a single declaration line, only serving to set properties on the underlying XAML element, or to add the element to a parent.
- Template Parameters
-
T | the XAML element type to hold. |
◆ Margin() [1/4]
◆ Margin() [2/4]
◆ Margin() [3/4]
◆ Margin() [4/4]
◆ Name() [1/2]
Returns the element's Name.
- Returns
◆ Name() [2/2]
Set the element's Name.
- Parameters
-
- Returns
◆ Padding() [1/4]
◆ Padding() [2/4]
◆ Padding() [3/4]
◆ Padding() [4/4]
◆ Set()
template<typename T >
template<typename TValue >
Sets a property.
- Template Parameters
-
- Parameters
-
dp | The DependencyProperty to set |
value | The value |
- Returns
Example:
.Set(Grid::RowProperty(), 3)
.Set(Grid::ColumnProperty(), 2);
auto Button(C c)
Creates a Button.
Definition: Controls.h:604
◆ VisualStates()
template<typename T >
auto cppxaml::details::WrapperT< T >::VisualStates |
( |
const std::unordered_map< std::wstring, cppxaml::xaml::VisualStateChangedEventHandler > & |
map | ) |
|
|
inline |
Sets up a visual state change listeners.
- Parameters
-
map | A map of visual state names to handlers |
- Returns
Example:
.VisualStates( {
{ L"PointerOver", [](auto&sender, cppxaml::xaml::VisualStateChangedEventArgs args) {
auto x = args.NewState().Name();
auto button = sender.as<Controls::Button>();
button.Content(winrt::box_value(x));
} },
{ L"Normal", [](auto&sender, auto&) {
auto button = sender.as<Controls::Button>();
button.Content(winrt::box_value(L"click me"));
} },
});
The documentation for this struct was generated from the following file: