1use crate::core::ThemeStyle;
4use crate::element::*;
5use crate::reference::{ElementRef, FocusControl, NativeElementRef};
6#[derive(Clone, Debug, Default, PartialEq)]
7pub(crate) struct BorderEvents {
8 on_drag_enter: Option<Callback<DragKind>>,
9 on_drag_over: Option<Callback<DragKind>>,
10 on_drag_leave: Option<Callback<()>>,
11 on_drop: Option<Callback<DroppedData>>,
12 on_pointer_pressed: Option<Callback<PointerEventInfo>>,
13 on_pointer_moved: Option<Callback<PointerEventInfo>>,
14 on_pointer_entered: Option<Callback<PointerEventInfo>>,
15 on_pointer_exited: Option<Callback<PointerEventInfo>>,
16 on_pointer_released: Option<Callback<PointerEventInfo>>,
17 on_pointer_capture_lost: Option<Callback<()>>,
18 on_pointer_canceled: Option<Callback<()>>,
19}
20#[derive(Clone, Debug, Default, PartialEq)]
21pub(crate) struct AutoSuggestBoxEvents {
22 on_text_changed: Option<Callback<String>>,
23 on_suggestion_chosen: Option<Callback<String>>,
24}
25#[derive(Clone, Debug, Default, PartialEq)]
26pub(crate) struct TitleBarEvents {
27 on_back_requested: Option<Callback<()>>,
28 on_pane_toggle_requested: Option<Callback<()>>,
29}
30#[derive(Clone, Debug, Default, PartialEq)]
31pub(crate) struct NavigationViewEvents {
32 on_is_pane_open_changed: Option<Callback<bool>>,
33 on_display_mode_changed: Option<Callback<NavigationViewDisplayMode>>,
34 on_selected_tag_changed: Option<Callback<Option<String>>>,
35}
36#[derive(Clone, Debug, Default, PartialEq)]
37pub(crate) struct ImageEvents {
38 on_opened: Option<Callback<()>>,
39 on_failed: Option<Callback<()>>,
40}
41#[derive(Clone, Debug, Default, PartialEq)]
42pub(crate) struct TabViewEvents {
43 on_selection_changed: Option<Callback<Option<usize>>>,
44 on_close_requested: Option<Callback<String>>,
45 on_add_tab_button_click: Option<Callback<()>>,
46 on_reordered: Option<Callback<Vec<String>>>,
47}
48#[derive(Clone, Debug, Default, PartialEq)]
49pub(crate) struct TeachingTipEvents {
50 on_closed: Option<Callback<()>>,
51 on_action_button_click: Option<Callback<()>>,
52}
53#[derive(Clone, Debug, Default, PartialEq)]
54pub(crate) struct ListViewEvents {
55 on_selection_changed: Option<Callback<Option<usize>>>,
56 on_reordered: Option<Callback<Vec<String>>>,
57}
58#[derive(Clone, Debug, Default, PartialEq)]
59pub(crate) struct GridViewEvents {
60 on_reordered: Option<Callback<Vec<String>>>,
61 on_selection_changed: Option<Callback<Option<usize>>>,
62}
63pub mod public {
64 use super::*;
65 #[non_exhaustive]
66 #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
67 pub enum ContentDialogResult {
68 #[default]
69 None,
70 Primary,
71 Secondary,
72 }
73 #[non_exhaustive]
74 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
75 pub enum ButtonStyle {
76 Default,
77 Accent,
78 Subtle,
79 TextLink,
80 }
81 #[non_exhaustive]
82 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
83 pub enum InfoBarSeverity {
84 Informational,
85 Success,
86 Warning,
87 Error,
88 }
89 #[non_exhaustive]
90 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
91 pub enum ListViewSelectionMode {
92 None,
93 Single,
94 Multiple,
95 Extended,
96 }
97 #[non_exhaustive]
98 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
99 pub enum NavigationViewBackButtonVisible {
100 Collapsed,
101 Visible,
102 Auto,
103 }
104 #[non_exhaustive]
105 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
106 pub enum NavigationViewPaneDisplayMode {
107 Auto,
108 Left,
109 Top,
110 LeftCompact,
111 LeftMinimal,
112 }
113 #[non_exhaustive]
114 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
115 pub enum Orientation {
116 Vertical,
117 Horizontal,
118 }
119 #[non_exhaustive]
120 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
121 pub enum PasswordRevealMode {
122 Peek,
123 Hidden,
124 Visible,
125 }
126 #[non_exhaustive]
127 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
128 pub enum ScrollBarVisibility {
129 Disabled,
130 Auto,
131 Hidden,
132 Visible,
133 }
134 #[non_exhaustive]
135 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
136 pub enum ScrollingScrollBarVisibility {
137 Auto,
138 Visible,
139 Hidden,
140 }
141 #[non_exhaustive]
142 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
143 pub enum SplitViewDisplayMode {
144 Overlay,
145 Inline,
146 CompactOverlay,
147 CompactInline,
148 }
149 #[non_exhaustive]
150 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
151 pub enum Stretch {
152 None,
153 Fill,
154 Uniform,
155 UniformToFill,
156 }
157 #[non_exhaustive]
158 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
159 pub enum Symbol {
160 Previous,
161 Next,
162 Play,
163 Pause,
164 Edit,
165 Save,
166 Clear,
167 Delete,
168 Remove,
169 Add,
170 Cancel,
171 Accept,
172 More,
173 Redo,
174 Undo,
175 Home,
176 Up,
177 Forward,
178 Back,
179 Favorite,
180 Camera,
181 Setting,
182 Video,
183 Sync,
184 Download,
185 Mail,
186 Find,
187 Help,
188 Upload,
189 Emoji,
190 TwoPage,
191 LeaveChat,
192 MailForward,
193 Clock,
194 Send,
195 Crop,
196 RotateCamera,
197 People,
198 OpenPane,
199 ClosePane,
200 World,
201 Flag,
202 PreviewLink,
203 Globe,
204 Trim,
205 AttachCamera,
206 ZoomIn,
207 Bookmarks,
208 Document,
209 ProtectedDocument,
210 Page,
211 Bullets,
212 Comment,
213 MailFilled,
214 ContactInfo,
215 HangUp,
216 ViewAll,
217 MapPin,
218 Phone,
219 VideoChat,
220 Switch,
221 Contact,
222 Rename,
223 Pin,
224 MusicInfo,
225 Go,
226 Keyboard,
227 DockLeft,
228 DockRight,
229 DockBottom,
230 Remote,
231 Refresh,
232 Rotate,
233 Shuffle,
234 List,
235 Shop,
236 SelectAll,
237 Orientation,
238 Import,
239 ImportAll,
240 BrowsePhotos,
241 WebCam,
242 Pictures,
243 SaveLocal,
244 Caption,
245 Stop,
246 ShowResults,
247 Volume,
248 Repair,
249 Message,
250 Page2,
251 CalendarDay,
252 CalendarWeek,
253 Calendar,
254 Character,
255 MailReplyAll,
256 Read,
257 Link,
258 Account,
259 ShowBcc,
260 HideBcc,
261 Cut,
262 Attach,
263 Paste,
264 Filter,
265 Copy,
266 Emoji2,
267 Important,
268 MailReply,
269 SlideShow,
270 Sort,
271 Manage,
272 AllApps,
273 DisconnectDrive,
274 MapDrive,
275 NewWindow,
276 OpenWith,
277 ContactPresence,
278 Priority,
279 GoToToday,
280 Font,
281 FontColor,
282 Contact2,
283 Folder,
284 Audio,
285 Placeholder,
286 View,
287 SetLockScreen,
288 SetTile,
289 ClosedCaption,
290 StopSlideShow,
291 Permissions,
292 Highlight,
293 DisableUpdates,
294 UnFavorite,
295 UnPin,
296 OpenLocal,
297 Mute,
298 Italic,
299 Underline,
300 Bold,
301 MoveToFolder,
302 LikeDislike,
303 Dislike,
304 Like,
305 AlignRight,
306 AlignCenter,
307 AlignLeft,
308 Zoom,
309 ZoomOut,
310 OpenFile,
311 OtherUser,
312 Admin,
313 Street,
314 Map,
315 ClearSelection,
316 FontDecrease,
317 FontIncrease,
318 FontSize,
319 CellPhone,
320 ReShare,
321 Tag,
322 RepeatOne,
323 RepeatAll,
324 OutlineStar,
325 SolidStar,
326 Calculator,
327 Directions,
328 Target,
329 Library,
330 PhoneBook,
331 Memo,
332 Microphone,
333 PostUpdate,
334 BackToWindow,
335 FullScreen,
336 NewFolder,
337 CalendarReply,
338 UnSyncFolder,
339 ReportHacked,
340 SyncFolder,
341 BlockContact,
342 SwitchApps,
343 AddFriend,
344 TouchPointer,
345 GoToStart,
346 ZeroBars,
347 OneBar,
348 TwoBars,
349 ThreeBars,
350 FourBars,
351 Scan,
352 Preview,
353 GlobalNavigationButton,
354 Share,
355 Print,
356 XboxOneConsole,
357 }
358 #[non_exhaustive]
359 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
360 pub enum TeachingTipPlacementMode {
361 Auto,
362 Top,
363 Bottom,
364 Left,
365 Right,
366 TopRight,
367 TopLeft,
368 BottomRight,
369 BottomLeft,
370 LeftTop,
371 LeftBottom,
372 RightTop,
373 RightBottom,
374 Center,
375 }
376 #[non_exhaustive]
377 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
378 pub enum TextTrimming {
379 None,
380 CharacterEllipsis,
381 WordEllipsis,
382 Clip,
383 }
384 #[non_exhaustive]
385 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
386 pub enum TextWrapping {
387 NoWrap,
388 Wrap,
389 WrapWholeWords,
390 }
391 #[non_exhaustive]
392 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
393 pub enum TreeViewSelectionMode {
394 None,
395 Single,
396 Multiple,
397 }
398 #[derive(Clone, Debug, Default, PartialEq)]
399 pub struct TextBlock {
400 text: Property<String>,
401 text_wrapping: Property<TextWrapping>,
402 font_size: Property<f64>,
403 font_weight: Property<FontWeight>,
404 is_text_selection_enabled: Property<bool>,
405 max_lines: Property<i32>,
406 text_trimming: Property<TextTrimming>,
407 foreground: Property<Brush>,
408 element_state: Option<std::rc::Rc<ElementState>>,
409 }
410 impl TextBlock {
411 pub fn new() -> Self {
412 Self::default()
413 }
414 pub fn text(mut self, value: impl Into<String>) -> Self {
415 self.text = Property::Set(value.into());
416 self
417 }
418 pub fn text_optional<T>(mut self, value: Option<T>) -> Self
419 where
420 T: Into<String>,
421 {
422 self.text = Property::from(value.map(Into::into));
423 self
424 }
425 pub fn text_wrapping(mut self, value: impl Into<Option<TextWrapping>>) -> Self {
426 let value = value.into();
427 self.text_wrapping = Property::from(value);
428 self
429 }
430 pub fn font_size(mut self, value: impl Into<Option<f64>>) -> Self {
431 let value = value.into();
432 assert!(
433 value
434 .as_ref()
435 .is_none_or(|value| value.is_finite() && *value > 0.0),
436 "TextBlock FontSize must be finite and positive",
437 );
438 self.font_size = Property::from(value);
439 self
440 }
441 pub fn font_weight(mut self, value: impl Into<Option<FontWeight>>) -> Self {
442 let value = value.into();
443 self.font_weight = Property::from(value);
444 self
445 }
446 pub fn is_text_selection_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
447 let value = value.into();
448 self.is_text_selection_enabled = Property::from(value);
449 self
450 }
451 pub fn max_lines(mut self, value: impl Into<Option<i32>>) -> Self {
452 let value = value.into();
453 assert!(
454 value.as_ref().is_none_or(|value| *value >= 0),
455 "TextBlock MaxLines must be non-negative"
456 );
457 self.max_lines = Property::from(value);
458 self
459 }
460 pub fn text_trimming(mut self, value: impl Into<Option<TextTrimming>>) -> Self {
461 let value = value.into();
462 self.text_trimming = Property::from(value);
463 self
464 }
465 pub fn foreground(mut self, value: impl Into<Brush>) -> Self {
466 self.foreground = Property::Set(value.into());
467 self
468 }
469 pub fn foreground_optional<T>(mut self, value: Option<T>) -> Self
470 where
471 T: Into<Brush>,
472 {
473 self.foreground = Property::from(value.map(Into::into));
474 self
475 }
476 }
477 impl sealed::Sealed for TextBlock {}
478 impl sealed::NativeControl for TextBlock {
479 fn into_element(self) -> Element {
480 self.into()
481 }
482 }
483 impl sealed::LayoutControl for TextBlock {
484 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
485 &mut self.element_state
486 }
487 }
488 impl LayoutControl for TextBlock {}
489 #[derive(Clone, Debug, Default, PartialEq)]
490 pub struct Button {
491 is_enabled: Property<bool>,
492 horizontal_content_alignment: Property<HorizontalAlignment>,
493 vertical_content_alignment: Property<VerticalAlignment>,
494 resource_overrides: Property<ResourceOverrides>,
495 style: Property<ButtonStyle>,
496 key_accelerators: Property<KeyAccelerators>,
497 on_click: Option<Callback<()>>,
498 reference: Option<NativeElementRef>,
499 element_state: Option<std::rc::Rc<ElementState>>,
500 content: Option<Box<Element>>,
501 }
502 impl Button {
503 pub fn new() -> Self {
504 Self::default()
505 }
506 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
507 self.reference = Some(reference.binding());
508 self
509 }
510 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
511 let value = value.into();
512 self.is_enabled = Property::from(value);
513 self
514 }
515 pub fn horizontal_content_alignment(
516 mut self,
517 value: impl Into<Option<HorizontalAlignment>>,
518 ) -> Self {
519 let value = value.into();
520 self.horizontal_content_alignment = Property::from(value);
521 self
522 }
523 pub fn vertical_content_alignment(
524 mut self,
525 value: impl Into<Option<VerticalAlignment>>,
526 ) -> Self {
527 let value = value.into();
528 self.vertical_content_alignment = Property::from(value);
529 self
530 }
531 pub fn resource_overrides(mut self, value: impl Into<Option<ResourceOverrides>>) -> Self {
532 let value = value.into();
533 self.resource_overrides = Property::from(value);
534 self
535 }
536 pub fn style(mut self, value: impl Into<Option<ButtonStyle>>) -> Self {
537 let value = value.into();
538 self.style = Property::from(value);
539 self
540 }
541 pub fn key_accelerators(mut self, value: impl Into<Option<KeyAccelerators>>) -> Self {
542 let value = value.into();
543 self.key_accelerators = Property::from(value);
544 self
545 }
546 pub fn on_click(mut self, callback: impl IntoUnitCallback) -> Self {
547 self.on_click = Some(callback.into_unit_callback());
548 self
549 }
550 }
551 impl sealed::Sealed for Button {}
552 impl sealed::NativeControl for Button {
553 fn into_element(self) -> Element {
554 self.into()
555 }
556 }
557 impl crate::reference::sealed::Sealed for Button {}
558 impl crate::reference::ReferenceControl for Button {}
559 impl sealed::LayoutControl for Button {
560 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
561 &mut self.element_state
562 }
563 }
564 impl LayoutControl for Button {}
565 impl sealed::ContentControl for Button {}
566 impl ContentControl for Button {}
567 impl FocusControl for Button {}
568 #[cfg(test)]
569 impl NativeContentTestExt for Button {
570 fn native_content(mut self, content: impl Into<Element>) -> Self {
571 self.content = Some(Box::new(content.into()));
572 self
573 }
574 }
575 #[derive(Clone, Debug, Default, PartialEq)]
576 pub struct HyperlinkButton {
577 navigate_uri: Property<String>,
578 is_enabled: Property<bool>,
579 on_click: Option<Callback<()>>,
580 reference: Option<NativeElementRef>,
581 element_state: Option<std::rc::Rc<ElementState>>,
582 content: Option<Box<Element>>,
583 }
584 impl HyperlinkButton {
585 pub fn new() -> Self {
586 Self::default()
587 }
588 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
589 self.reference = Some(reference.binding());
590 self
591 }
592 pub fn navigate_uri(mut self, value: impl Into<String>) -> windows_core::Result<Self> {
593 let value = value.into();
594 validate_uri(&value)?;
595 self.navigate_uri = Property::Set(value);
596 Ok(self)
597 }
598 pub fn navigate_uri_optional<T>(mut self, value: Option<T>) -> windows_core::Result<Self>
599 where
600 T: Into<String>,
601 {
602 self.navigate_uri = match value {
603 Some(value) => {
604 let value = value.into();
605 validate_uri(&value)?;
606 Property::Set(value)
607 }
608 None => Property::Inherited,
609 };
610 Ok(self)
611 }
612 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
613 let value = value.into();
614 self.is_enabled = Property::from(value);
615 self
616 }
617 pub fn on_click(mut self, callback: impl IntoUnitCallback) -> Self {
618 self.on_click = Some(callback.into_unit_callback());
619 self
620 }
621 }
622 impl sealed::Sealed for HyperlinkButton {}
623 impl sealed::NativeControl for HyperlinkButton {
624 fn into_element(self) -> Element {
625 self.into()
626 }
627 }
628 impl crate::reference::sealed::Sealed for HyperlinkButton {}
629 impl crate::reference::ReferenceControl for HyperlinkButton {}
630 impl sealed::LayoutControl for HyperlinkButton {
631 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
632 &mut self.element_state
633 }
634 }
635 impl LayoutControl for HyperlinkButton {}
636 impl sealed::ContentControl for HyperlinkButton {}
637 impl ContentControl for HyperlinkButton {}
638 impl FocusControl for HyperlinkButton {}
639 #[cfg(test)]
640 impl NativeContentTestExt for HyperlinkButton {
641 fn native_content(mut self, content: impl Into<Element>) -> Self {
642 self.content = Some(Box::new(content.into()));
643 self
644 }
645 }
646 #[derive(Clone, Debug, Default, PartialEq)]
647 pub struct RepeatButton {
648 delay: Property<i32>,
649 interval: Property<i32>,
650 is_enabled: Property<bool>,
651 on_click: Option<Callback<()>>,
652 element_state: Option<std::rc::Rc<ElementState>>,
653 content: Option<Box<Element>>,
654 }
655 impl RepeatButton {
656 pub fn new() -> Self {
657 Self::default()
658 }
659 pub fn delay(mut self, value: impl Into<Option<i32>>) -> Self {
660 let value = value.into();
661 self.delay = Property::from(value);
662 self
663 }
664 pub fn interval(mut self, value: impl Into<Option<i32>>) -> Self {
665 let value = value.into();
666 self.interval = Property::from(value);
667 self
668 }
669 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
670 let value = value.into();
671 self.is_enabled = Property::from(value);
672 self
673 }
674 pub fn on_click(mut self, callback: impl IntoUnitCallback) -> Self {
675 self.on_click = Some(callback.into_unit_callback());
676 self
677 }
678 }
679 impl sealed::Sealed for RepeatButton {}
680 impl sealed::NativeControl for RepeatButton {
681 fn into_element(self) -> Element {
682 self.into()
683 }
684 }
685 impl sealed::LayoutControl for RepeatButton {
686 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
687 &mut self.element_state
688 }
689 }
690 impl LayoutControl for RepeatButton {}
691 impl sealed::ContentControl for RepeatButton {}
692 impl ContentControl for RepeatButton {}
693 #[cfg(test)]
694 impl NativeContentTestExt for RepeatButton {
695 fn native_content(mut self, content: impl Into<Element>) -> Self {
696 self.content = Some(Box::new(content.into()));
697 self
698 }
699 }
700 #[derive(Clone, Debug, Default, PartialEq)]
701 pub struct Border {
702 padding: Property<Thickness>,
703 border_thickness: Property<Thickness>,
704 corner_radius: Property<CornerRadius>,
705 background: Property<Brush>,
706 border_brush: Property<Brush>,
707 opacity_transition: Property<std::time::Duration>,
708 scale: Property<f64>,
709 scale_transition: Property<std::time::Duration>,
710 capture_pointer_on_press: Property<bool>,
711 drop_policy: Property<DragDropPolicy>,
712 events: Option<std::rc::Rc<BorderEvents>>,
713 element_state: Option<std::rc::Rc<ElementState>>,
714 content: Option<Box<Element>>,
715 }
716 impl Border {
717 pub fn new() -> Self {
718 Self::default()
719 }
720 pub fn padding(mut self, value: impl Into<Thickness>) -> Self {
721 let value = value.into();
722 assert!(
723 value.is_finite_non_negative(),
724 "Border Padding must contain finite non-negative values"
725 );
726 self.padding = Property::Set(value);
727 self
728 }
729 pub fn padding_optional<T>(mut self, value: Option<T>) -> Self
730 where
731 T: Into<Thickness>,
732 {
733 let value = value.map(Into::into);
734 assert!(
735 value
736 .as_ref()
737 .is_none_or(|value| value.is_finite_non_negative()),
738 "Border Padding must contain finite non-negative values",
739 );
740 self.padding = Property::from(value);
741 self
742 }
743 pub fn border_thickness(mut self, value: impl Into<Thickness>) -> Self {
744 let value = value.into();
745 assert!(
746 value.is_finite_non_negative(),
747 "Border BorderThickness must contain finite non-negative values"
748 );
749 self.border_thickness = Property::Set(value);
750 self
751 }
752 pub fn border_thickness_optional<T>(mut self, value: Option<T>) -> Self
753 where
754 T: Into<Thickness>,
755 {
756 let value = value.map(Into::into);
757 assert!(
758 value
759 .as_ref()
760 .is_none_or(|value| value.is_finite_non_negative()),
761 "Border BorderThickness must contain finite non-negative values",
762 );
763 self.border_thickness = Property::from(value);
764 self
765 }
766 pub fn corner_radius(mut self, value: impl Into<CornerRadius>) -> Self {
767 let value = value.into();
768 assert!(
769 value.is_finite_non_negative(),
770 "Border CornerRadius must contain finite non-negative values"
771 );
772 self.corner_radius = Property::Set(value);
773 self
774 }
775 pub fn corner_radius_optional<T>(mut self, value: Option<T>) -> Self
776 where
777 T: Into<CornerRadius>,
778 {
779 let value = value.map(Into::into);
780 assert!(
781 value
782 .as_ref()
783 .is_none_or(|value| value.is_finite_non_negative()),
784 "Border CornerRadius must contain finite non-negative values",
785 );
786 self.corner_radius = Property::from(value);
787 self
788 }
789 pub fn background(mut self, value: impl Into<Brush>) -> Self {
790 self.background = Property::Set(value.into());
791 self
792 }
793 pub fn background_optional<T>(mut self, value: Option<T>) -> Self
794 where
795 T: Into<Brush>,
796 {
797 self.background = Property::from(value.map(Into::into));
798 self
799 }
800 pub fn border_brush(mut self, value: impl Into<Brush>) -> Self {
801 self.border_brush = Property::Set(value.into());
802 self
803 }
804 pub fn border_brush_optional<T>(mut self, value: Option<T>) -> Self
805 where
806 T: Into<Brush>,
807 {
808 self.border_brush = Property::from(value.map(Into::into));
809 self
810 }
811 pub fn opacity_transition(mut self, value: impl Into<Option<std::time::Duration>>) -> Self {
812 let value = value.into();
813 self.opacity_transition = Property::from(value);
814 self
815 }
816 pub fn scale(mut self, value: impl Into<Option<f64>>) -> Self {
817 let value = value.into();
818 assert!(
819 value
820 .as_ref()
821 .is_none_or(|value| value.is_finite() && *value >= 0.0),
822 "Border Scale must contain finite non-negative values",
823 );
824 self.scale = Property::from(value);
825 self
826 }
827 pub fn scale_transition(mut self, value: impl Into<Option<std::time::Duration>>) -> Self {
828 let value = value.into();
829 self.scale_transition = Property::from(value);
830 self
831 }
832 pub fn capture_pointer_on_press(mut self, value: impl Into<Option<bool>>) -> Self {
833 let value = value.into();
834 self.capture_pointer_on_press = Property::from(value);
835 self
836 }
837 pub fn drop_policy(mut self, value: impl Into<Option<DragDropPolicy>>) -> Self {
838 let value = value.into();
839 self.drop_policy = Property::from(value);
840 self
841 }
842 pub fn on_drag_enter(mut self, callback: impl IntoPayloadCallback<DragKind>) -> Self {
843 std::rc::Rc::make_mut(
844 self.events
845 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
846 )
847 .on_drag_enter = Some(callback.into_payload_callback());
848 self
849 }
850 pub fn on_drag_over(mut self, callback: impl IntoPayloadCallback<DragKind>) -> Self {
851 std::rc::Rc::make_mut(
852 self.events
853 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
854 )
855 .on_drag_over = Some(callback.into_payload_callback());
856 self
857 }
858 pub fn on_drag_leave(mut self, callback: impl IntoUnitCallback) -> Self {
859 std::rc::Rc::make_mut(
860 self.events
861 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
862 )
863 .on_drag_leave = Some(callback.into_unit_callback());
864 self
865 }
866 pub fn on_drop(mut self, callback: impl IntoPayloadCallback<DroppedData>) -> Self {
867 std::rc::Rc::make_mut(
868 self.events
869 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
870 )
871 .on_drop = Some(callback.into_payload_callback());
872 self
873 }
874 pub fn on_pointer_pressed(
875 mut self,
876 callback: impl IntoPayloadCallback<PointerEventInfo>,
877 ) -> Self {
878 std::rc::Rc::make_mut(
879 self.events
880 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
881 )
882 .on_pointer_pressed = Some(callback.into_payload_callback());
883 self
884 }
885 pub fn on_pointer_moved(
886 mut self,
887 callback: impl IntoPayloadCallback<PointerEventInfo>,
888 ) -> Self {
889 std::rc::Rc::make_mut(
890 self.events
891 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
892 )
893 .on_pointer_moved = Some(callback.into_payload_callback());
894 self
895 }
896 pub fn on_pointer_entered(
897 mut self,
898 callback: impl IntoPayloadCallback<PointerEventInfo>,
899 ) -> Self {
900 std::rc::Rc::make_mut(
901 self.events
902 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
903 )
904 .on_pointer_entered = Some(callback.into_payload_callback());
905 self
906 }
907 pub fn on_pointer_exited(
908 mut self,
909 callback: impl IntoPayloadCallback<PointerEventInfo>,
910 ) -> Self {
911 std::rc::Rc::make_mut(
912 self.events
913 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
914 )
915 .on_pointer_exited = Some(callback.into_payload_callback());
916 self
917 }
918 pub fn on_pointer_released(
919 mut self,
920 callback: impl IntoPayloadCallback<PointerEventInfo>,
921 ) -> Self {
922 std::rc::Rc::make_mut(
923 self.events
924 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
925 )
926 .on_pointer_released = Some(callback.into_payload_callback());
927 self
928 }
929 pub fn on_pointer_capture_lost(mut self, callback: impl IntoUnitCallback) -> Self {
930 std::rc::Rc::make_mut(
931 self.events
932 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
933 )
934 .on_pointer_capture_lost = Some(callback.into_unit_callback());
935 self
936 }
937 pub fn on_pointer_canceled(mut self, callback: impl IntoUnitCallback) -> Self {
938 std::rc::Rc::make_mut(
939 self.events
940 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
941 )
942 .on_pointer_canceled = Some(callback.into_unit_callback());
943 self
944 }
945 }
946 impl sealed::Sealed for Border {}
947 impl sealed::NativeControl for Border {
948 fn into_element(self) -> Element {
949 self.into()
950 }
951 }
952 impl sealed::LayoutControl for Border {
953 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
954 &mut self.element_state
955 }
956 }
957 impl LayoutControl for Border {}
958 impl sealed::ContentControl for Border {}
959 impl ContentControl for Border {}
960 #[cfg(test)]
961 impl NativeContentTestExt for Border {
962 fn native_content(mut self, content: impl Into<Element>) -> Self {
963 self.content = Some(Box::new(content.into()));
964 self
965 }
966 }
967 #[derive(Clone, Debug, Default, PartialEq)]
968 pub struct BreadcrumbBar {
969 items_source: Property<std::rc::Rc<Vec<String>>>,
970 on_item_clicked: Option<Callback<String>>,
971 element_state: Option<std::rc::Rc<ElementState>>,
972 }
973 impl BreadcrumbBar {
974 pub fn new() -> Self {
975 Self::default()
976 }
977 pub fn items_source<I, S>(mut self, value: I) -> Self
978 where
979 I: IntoIterator<Item = S>,
980 S: Into<String>,
981 {
982 self.items_source = Property::Set(std::rc::Rc::new(
983 value.into_iter().map(Into::into).collect(),
984 ));
985 self
986 }
987 pub fn items_source_optional<I, S>(mut self, value: Option<I>) -> Self
988 where
989 I: IntoIterator<Item = S>,
990 S: Into<String>,
991 {
992 self.items_source = Property::from(
993 value.map(|value| std::rc::Rc::new(value.into_iter().map(Into::into).collect())),
994 );
995 self
996 }
997 pub fn on_item_clicked(mut self, callback: impl IntoPayloadCallback<String>) -> Self {
998 self.on_item_clicked = Some(callback.into_payload_callback());
999 self
1000 }
1001 }
1002 impl sealed::Sealed for BreadcrumbBar {}
1003 impl sealed::NativeControl for BreadcrumbBar {
1004 fn into_element(self) -> Element {
1005 self.into()
1006 }
1007 }
1008 impl sealed::LayoutControl for BreadcrumbBar {
1009 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
1010 &mut self.element_state
1011 }
1012 }
1013 impl LayoutControl for BreadcrumbBar {}
1014 #[derive(Clone, Debug, Default, PartialEq)]
1015 pub struct StackPanel {
1016 orientation: Property<Orientation>,
1017 spacing: Property<f64>,
1018 element_state: Option<std::rc::Rc<ElementState>>,
1019 children: std::rc::Rc<Vec<KeyedElement>>,
1020 }
1021 impl StackPanel {
1022 pub fn new() -> Self {
1023 Self::default()
1024 }
1025 pub fn orientation(mut self, value: impl Into<Option<Orientation>>) -> Self {
1026 let value = value.into();
1027 self.orientation = Property::from(value);
1028 self
1029 }
1030 pub fn spacing(mut self, value: impl Into<Option<f64>>) -> Self {
1031 let value = value.into();
1032 self.spacing = Property::from(value);
1033 self
1034 }
1035 }
1036 impl sealed::Sealed for StackPanel {}
1037 impl sealed::NativeControl for StackPanel {
1038 fn into_element(self) -> Element {
1039 self.into()
1040 }
1041 }
1042 impl sealed::LayoutControl for StackPanel {
1043 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
1044 &mut self.element_state
1045 }
1046 }
1047 impl LayoutControl for StackPanel {}
1048 impl ChildrenControl for StackPanel {}
1049 #[cfg(test)]
1050 impl NativeChildrenTestExt for StackPanel {
1051 fn native_child(mut self, key: impl Into<Key>, child: impl Into<Element>) -> Self {
1052 std::rc::Rc::make_mut(&mut self.children).push(KeyedElement::new(key, child));
1053 self
1054 }
1055 fn native_children(mut self, children: impl IntoIterator<Item = KeyedElement>) -> Self {
1056 self.children = std::rc::Rc::new(children.into_iter().collect());
1057 self
1058 }
1059 }
1060 #[derive(Clone, Debug, Default, PartialEq)]
1061 pub struct VariableSizedWrapGrid {
1062 item_width: Property<f64>,
1063 item_height: Property<f64>,
1064 orientation: Property<Orientation>,
1065 element_state: Option<std::rc::Rc<ElementState>>,
1066 children: std::rc::Rc<Vec<KeyedElement>>,
1067 }
1068 impl VariableSizedWrapGrid {
1069 pub fn new() -> Self {
1070 Self::default()
1071 }
1072 pub fn item_width(mut self, value: impl Into<Option<f64>>) -> Self {
1073 let value = value.into();
1074 assert!(
1075 value
1076 .as_ref()
1077 .is_none_or(|value| value.is_finite() && *value > 0.0),
1078 "VariableSizedWrapGrid ItemWidth must be finite and positive",
1079 );
1080 self.item_width = Property::from(value);
1081 self
1082 }
1083 pub fn item_height(mut self, value: impl Into<Option<f64>>) -> Self {
1084 let value = value.into();
1085 assert!(
1086 value
1087 .as_ref()
1088 .is_none_or(|value| value.is_finite() && *value > 0.0),
1089 "VariableSizedWrapGrid ItemHeight must be finite and positive",
1090 );
1091 self.item_height = Property::from(value);
1092 self
1093 }
1094 pub fn orientation(mut self, value: impl Into<Option<Orientation>>) -> Self {
1095 let value = value.into();
1096 self.orientation = Property::from(value);
1097 self
1098 }
1099 }
1100 impl sealed::Sealed for VariableSizedWrapGrid {}
1101 impl sealed::NativeControl for VariableSizedWrapGrid {
1102 fn into_element(self) -> Element {
1103 self.into()
1104 }
1105 }
1106 impl sealed::LayoutControl for VariableSizedWrapGrid {
1107 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
1108 &mut self.element_state
1109 }
1110 }
1111 impl LayoutControl for VariableSizedWrapGrid {}
1112 impl ChildrenControl for VariableSizedWrapGrid {}
1113 #[cfg(test)]
1114 impl NativeChildrenTestExt for VariableSizedWrapGrid {
1115 fn native_child(mut self, key: impl Into<Key>, child: impl Into<Element>) -> Self {
1116 std::rc::Rc::make_mut(&mut self.children).push(KeyedElement::new(key, child));
1117 self
1118 }
1119 fn native_children(mut self, children: impl IntoIterator<Item = KeyedElement>) -> Self {
1120 self.children = std::rc::Rc::new(children.into_iter().collect());
1121 self
1122 }
1123 }
1124 #[derive(Clone, Debug, Default, PartialEq)]
1125 pub struct Grid {
1126 row_spacing: Property<f64>,
1127 column_spacing: Property<f64>,
1128 key_accelerators: Property<KeyAccelerators>,
1129 background: Property<Brush>,
1130 reference: Option<NativeElementRef>,
1131 element_state: Option<std::rc::Rc<ElementState>>,
1132 rows: Property<std::rc::Rc<Vec<GridLength>>>,
1133 columns: Property<std::rc::Rc<Vec<GridLength>>>,
1134 children: std::rc::Rc<Vec<KeyedElement>>,
1135 }
1136 impl Grid {
1137 pub fn new() -> Self {
1138 Self::default()
1139 }
1140 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
1141 self.reference = Some(reference.binding());
1142 self
1143 }
1144 pub fn row_spacing(mut self, value: impl Into<Option<f64>>) -> Self {
1145 let value = value.into();
1146 self.row_spacing = Property::from(value);
1147 self
1148 }
1149 pub fn column_spacing(mut self, value: impl Into<Option<f64>>) -> Self {
1150 let value = value.into();
1151 self.column_spacing = Property::from(value);
1152 self
1153 }
1154 pub fn key_accelerators(mut self, value: impl Into<Option<KeyAccelerators>>) -> Self {
1155 let value = value.into();
1156 self.key_accelerators = Property::from(value);
1157 self
1158 }
1159 pub fn background(mut self, value: impl Into<Brush>) -> Self {
1160 self.background = Property::Set(value.into());
1161 self
1162 }
1163 pub fn background_optional<T>(mut self, value: Option<T>) -> Self
1164 where
1165 T: Into<Brush>,
1166 {
1167 self.background = Property::from(value.map(Into::into));
1168 self
1169 }
1170 pub fn rows(mut self, values: impl IntoIterator<Item = GridLength>) -> Self {
1171 let values = values.into_iter().collect::<Vec<_>>();
1172 assert!(
1173 values.iter().all(|value| value.is_valid()),
1174 "Grid lengths must be finite and non-negative",
1175 );
1176 self.rows = Property::Set(std::rc::Rc::new(values));
1177 self
1178 }
1179 pub fn rows_optional<T>(mut self, values: Option<T>) -> Self
1180 where
1181 T: IntoIterator<Item = GridLength>,
1182 {
1183 self.rows = Property::from(values.map(|values| {
1184 let values = values.into_iter().collect::<Vec<_>>();
1185 assert!(
1186 values.iter().all(|value| value.is_valid()),
1187 "Grid lengths must be finite and non-negative",
1188 );
1189 std::rc::Rc::new(values)
1190 }));
1191 self
1192 }
1193 pub fn columns(mut self, values: impl IntoIterator<Item = GridLength>) -> Self {
1194 let values = values.into_iter().collect::<Vec<_>>();
1195 assert!(
1196 values.iter().all(|value| value.is_valid()),
1197 "Grid lengths must be finite and non-negative",
1198 );
1199 self.columns = Property::Set(std::rc::Rc::new(values));
1200 self
1201 }
1202 pub fn columns_optional<T>(mut self, values: Option<T>) -> Self
1203 where
1204 T: IntoIterator<Item = GridLength>,
1205 {
1206 self.columns = Property::from(values.map(|values| {
1207 let values = values.into_iter().collect::<Vec<_>>();
1208 assert!(
1209 values.iter().all(|value| value.is_valid()),
1210 "Grid lengths must be finite and non-negative",
1211 );
1212 std::rc::Rc::new(values)
1213 }));
1214 self
1215 }
1216 }
1217 impl sealed::Sealed for Grid {}
1218 impl sealed::NativeControl for Grid {
1219 fn into_element(self) -> Element {
1220 self.into()
1221 }
1222 }
1223 impl crate::reference::sealed::Sealed for Grid {}
1224 impl crate::reference::ReferenceControl for Grid {}
1225 impl sealed::LayoutControl for Grid {
1226 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
1227 &mut self.element_state
1228 }
1229 }
1230 impl LayoutControl for Grid {}
1231 impl ChildrenControl for Grid {}
1232 #[cfg(test)]
1233 impl NativeChildrenTestExt for Grid {
1234 fn native_child(mut self, key: impl Into<Key>, child: impl Into<Element>) -> Self {
1235 std::rc::Rc::make_mut(&mut self.children).push(KeyedElement::new(key, child));
1236 self
1237 }
1238 fn native_children(mut self, children: impl IntoIterator<Item = KeyedElement>) -> Self {
1239 self.children = std::rc::Rc::new(children.into_iter().collect());
1240 self
1241 }
1242 }
1243 #[derive(Clone, Debug, Default, PartialEq)]
1244 pub struct TextBox {
1245 text: Property<String>,
1246 placeholder_text: Property<String>,
1247 is_enabled: Property<bool>,
1248 accepts_return: Property<bool>,
1249 text_wrapping: Property<TextWrapping>,
1250 background: Property<Brush>,
1251 border_brush: Property<Brush>,
1252 border_thickness: Property<Thickness>,
1253 on_text_changed: Option<Callback<String>>,
1254 reference: Option<NativeElementRef>,
1255 element_state: Option<std::rc::Rc<ElementState>>,
1256 }
1257 impl TextBox {
1258 pub fn new() -> Self {
1259 Self::default()
1260 }
1261 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
1262 self.reference = Some(reference.binding());
1263 self
1264 }
1265 pub fn text(mut self, value: impl Into<String>) -> Self {
1266 self.text = Property::Set(value.into());
1267 self
1268 }
1269 pub fn text_optional<T>(mut self, value: Option<T>) -> Self
1270 where
1271 T: Into<String>,
1272 {
1273 self.text = Property::from(value.map(Into::into));
1274 self
1275 }
1276 pub fn placeholder_text(mut self, value: impl Into<String>) -> Self {
1277 self.placeholder_text = Property::Set(value.into());
1278 self
1279 }
1280 pub fn placeholder_text_optional<T>(mut self, value: Option<T>) -> Self
1281 where
1282 T: Into<String>,
1283 {
1284 self.placeholder_text = Property::from(value.map(Into::into));
1285 self
1286 }
1287 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
1288 let value = value.into();
1289 self.is_enabled = Property::from(value);
1290 self
1291 }
1292 pub fn accepts_return(mut self, value: impl Into<Option<bool>>) -> Self {
1293 let value = value.into();
1294 self.accepts_return = Property::from(value);
1295 self
1296 }
1297 pub fn text_wrapping(mut self, value: impl Into<Option<TextWrapping>>) -> Self {
1298 let value = value.into();
1299 self.text_wrapping = Property::from(value);
1300 self
1301 }
1302 pub fn background(mut self, value: impl Into<Brush>) -> Self {
1303 self.background = Property::Set(value.into());
1304 self
1305 }
1306 pub fn background_optional<T>(mut self, value: Option<T>) -> Self
1307 where
1308 T: Into<Brush>,
1309 {
1310 self.background = Property::from(value.map(Into::into));
1311 self
1312 }
1313 pub fn border_brush(mut self, value: impl Into<Brush>) -> Self {
1314 self.border_brush = Property::Set(value.into());
1315 self
1316 }
1317 pub fn border_brush_optional<T>(mut self, value: Option<T>) -> Self
1318 where
1319 T: Into<Brush>,
1320 {
1321 self.border_brush = Property::from(value.map(Into::into));
1322 self
1323 }
1324 pub fn border_thickness(mut self, value: impl Into<Thickness>) -> Self {
1325 let value = value.into();
1326 assert!(
1327 value.is_finite_non_negative(),
1328 "TextBox BorderThickness must contain finite non-negative values"
1329 );
1330 self.border_thickness = Property::Set(value);
1331 self
1332 }
1333 pub fn border_thickness_optional<T>(mut self, value: Option<T>) -> Self
1334 where
1335 T: Into<Thickness>,
1336 {
1337 let value = value.map(Into::into);
1338 assert!(
1339 value
1340 .as_ref()
1341 .is_none_or(|value| value.is_finite_non_negative()),
1342 "TextBox BorderThickness must contain finite non-negative values",
1343 );
1344 self.border_thickness = Property::from(value);
1345 self
1346 }
1347 pub fn on_text_changed(mut self, callback: impl IntoPayloadCallback<String>) -> Self {
1348 self.on_text_changed = Some(callback.into_payload_callback());
1349 self
1350 }
1351 }
1352 impl sealed::Sealed for TextBox {}
1353 impl sealed::NativeControl for TextBox {
1354 fn into_element(self) -> Element {
1355 self.into()
1356 }
1357 }
1358 impl crate::reference::sealed::Sealed for TextBox {}
1359 impl crate::reference::ReferenceControl for TextBox {}
1360 impl sealed::LayoutControl for TextBox {
1361 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
1362 &mut self.element_state
1363 }
1364 }
1365 impl LayoutControl for TextBox {}
1366 impl FocusControl for TextBox {}
1367 #[non_exhaustive]
1368 #[repr(u8)]
1369 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
1370 pub enum TextBoxSlot {
1371 Header,
1372 }
1373 impl sealed::SlotIndex<TextBoxSlot> for TextBox {
1374 fn slot_index(slot: TextBoxSlot) -> u8 {
1375 slot as u8
1376 }
1377 }
1378 impl SlotsControl for TextBox {
1379 type Slot = TextBoxSlot;
1380 }
1381 #[derive(Clone, Debug, Default, PartialEq)]
1382 pub struct AutoSuggestBox {
1383 text: Property<String>,
1384 items_source: Property<std::rc::Rc<Vec<String>>>,
1385 placeholder_text: Property<String>,
1386 is_enabled: Property<bool>,
1387 events: Option<std::rc::Rc<AutoSuggestBoxEvents>>,
1388 reference: Option<NativeElementRef>,
1389 element_state: Option<std::rc::Rc<ElementState>>,
1390 }
1391 impl AutoSuggestBox {
1392 pub fn new() -> Self {
1393 Self::default()
1394 }
1395 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
1396 self.reference = Some(reference.binding());
1397 self
1398 }
1399 pub fn text(mut self, value: impl Into<String>) -> Self {
1400 self.text = Property::Set(value.into());
1401 self
1402 }
1403 pub fn text_optional<T>(mut self, value: Option<T>) -> Self
1404 where
1405 T: Into<String>,
1406 {
1407 self.text = Property::from(value.map(Into::into));
1408 self
1409 }
1410 pub fn items_source<I, S>(mut self, value: I) -> Self
1411 where
1412 I: IntoIterator<Item = S>,
1413 S: Into<String>,
1414 {
1415 self.items_source = Property::Set(std::rc::Rc::new(
1416 value.into_iter().map(Into::into).collect(),
1417 ));
1418 self
1419 }
1420 pub fn items_source_optional<I, S>(mut self, value: Option<I>) -> Self
1421 where
1422 I: IntoIterator<Item = S>,
1423 S: Into<String>,
1424 {
1425 self.items_source = Property::from(
1426 value.map(|value| std::rc::Rc::new(value.into_iter().map(Into::into).collect())),
1427 );
1428 self
1429 }
1430 pub fn placeholder_text(mut self, value: impl Into<String>) -> Self {
1431 self.placeholder_text = Property::Set(value.into());
1432 self
1433 }
1434 pub fn placeholder_text_optional<T>(mut self, value: Option<T>) -> Self
1435 where
1436 T: Into<String>,
1437 {
1438 self.placeholder_text = Property::from(value.map(Into::into));
1439 self
1440 }
1441 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
1442 let value = value.into();
1443 self.is_enabled = Property::from(value);
1444 self
1445 }
1446 pub fn on_text_changed(mut self, callback: impl IntoPayloadCallback<String>) -> Self {
1447 std::rc::Rc::make_mut(
1448 self.events
1449 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
1450 )
1451 .on_text_changed = Some(callback.into_payload_callback());
1452 self
1453 }
1454 pub fn on_suggestion_chosen(mut self, callback: impl IntoPayloadCallback<String>) -> Self {
1455 std::rc::Rc::make_mut(
1456 self.events
1457 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
1458 )
1459 .on_suggestion_chosen = Some(callback.into_payload_callback());
1460 self
1461 }
1462 }
1463 impl sealed::Sealed for AutoSuggestBox {}
1464 impl sealed::NativeControl for AutoSuggestBox {
1465 fn into_element(self) -> Element {
1466 self.into()
1467 }
1468 }
1469 impl crate::reference::sealed::Sealed for AutoSuggestBox {}
1470 impl crate::reference::ReferenceControl for AutoSuggestBox {}
1471 impl sealed::LayoutControl for AutoSuggestBox {
1472 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
1473 &mut self.element_state
1474 }
1475 }
1476 impl LayoutControl for AutoSuggestBox {}
1477 impl FocusControl for AutoSuggestBox {}
1478 #[non_exhaustive]
1479 #[repr(u8)]
1480 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
1481 pub enum AutoSuggestBoxSlot {
1482 Header,
1483 }
1484 impl sealed::SlotIndex<AutoSuggestBoxSlot> for AutoSuggestBox {
1485 fn slot_index(slot: AutoSuggestBoxSlot) -> u8 {
1486 slot as u8
1487 }
1488 }
1489 impl SlotsControl for AutoSuggestBox {
1490 type Slot = AutoSuggestBoxSlot;
1491 }
1492 #[derive(Clone, Debug, Default, PartialEq)]
1493 pub struct PasswordBox {
1494 password: Property<String>,
1495 placeholder_text: Property<String>,
1496 password_reveal_mode: Property<PasswordRevealMode>,
1497 is_enabled: Property<bool>,
1498 on_password_changed: Option<Callback<String>>,
1499 reference: Option<NativeElementRef>,
1500 element_state: Option<std::rc::Rc<ElementState>>,
1501 }
1502 impl PasswordBox {
1503 pub fn new() -> Self {
1504 Self::default()
1505 }
1506 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
1507 self.reference = Some(reference.binding());
1508 self
1509 }
1510 pub fn password(mut self, value: impl Into<String>) -> Self {
1511 self.password = Property::Set(value.into());
1512 self
1513 }
1514 pub fn password_optional<T>(mut self, value: Option<T>) -> Self
1515 where
1516 T: Into<String>,
1517 {
1518 self.password = Property::from(value.map(Into::into));
1519 self
1520 }
1521 pub fn placeholder_text(mut self, value: impl Into<String>) -> Self {
1522 self.placeholder_text = Property::Set(value.into());
1523 self
1524 }
1525 pub fn placeholder_text_optional<T>(mut self, value: Option<T>) -> Self
1526 where
1527 T: Into<String>,
1528 {
1529 self.placeholder_text = Property::from(value.map(Into::into));
1530 self
1531 }
1532 pub fn password_reveal_mode(
1533 mut self,
1534 value: impl Into<Option<PasswordRevealMode>>,
1535 ) -> Self {
1536 let value = value.into();
1537 self.password_reveal_mode = Property::from(value);
1538 self
1539 }
1540 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
1541 let value = value.into();
1542 self.is_enabled = Property::from(value);
1543 self
1544 }
1545 pub fn on_password_changed(mut self, callback: impl IntoPayloadCallback<String>) -> Self {
1546 self.on_password_changed = Some(callback.into_payload_callback());
1547 self
1548 }
1549 }
1550 impl sealed::Sealed for PasswordBox {}
1551 impl sealed::NativeControl for PasswordBox {
1552 fn into_element(self) -> Element {
1553 self.into()
1554 }
1555 }
1556 impl crate::reference::sealed::Sealed for PasswordBox {}
1557 impl crate::reference::ReferenceControl for PasswordBox {}
1558 impl sealed::LayoutControl for PasswordBox {
1559 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
1560 &mut self.element_state
1561 }
1562 }
1563 impl LayoutControl for PasswordBox {}
1564 impl FocusControl for PasswordBox {}
1565 #[non_exhaustive]
1566 #[repr(u8)]
1567 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
1568 pub enum PasswordBoxSlot {
1569 Header,
1570 }
1571 impl sealed::SlotIndex<PasswordBoxSlot> for PasswordBox {
1572 fn slot_index(slot: PasswordBoxSlot) -> u8 {
1573 slot as u8
1574 }
1575 }
1576 impl SlotsControl for PasswordBox {
1577 type Slot = PasswordBoxSlot;
1578 }
1579 #[derive(Clone, Debug, Default, PartialEq)]
1580 pub struct NumberBox {
1581 minimum: Property<f64>,
1582 maximum: Property<f64>,
1583 value: Property<Option<f64>>,
1584 is_enabled: Property<bool>,
1585 on_value_changed: Option<Callback<Option<f64>>>,
1586 reference: Option<NativeElementRef>,
1587 element_state: Option<std::rc::Rc<ElementState>>,
1588 }
1589 impl NumberBox {
1590 pub fn new() -> Self {
1591 Self::default()
1592 }
1593 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
1594 self.reference = Some(reference.binding());
1595 self
1596 }
1597 pub fn minimum(mut self, value: impl Into<Option<f64>>) -> Self {
1598 let value = value.into();
1599 self.minimum = Property::from(value);
1600 self
1601 }
1602 pub fn maximum(mut self, value: impl Into<Option<f64>>) -> Self {
1603 let value = value.into();
1604 self.maximum = Property::from(value);
1605 self
1606 }
1607 pub fn value(mut self, value: impl Into<Option<f64>>) -> Self {
1608 let value = value.into().filter(|value| !value.is_nan());
1609 self.value = Property::Set(value);
1610 self
1611 }
1612 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
1613 let value = value.into();
1614 self.is_enabled = Property::from(value);
1615 self
1616 }
1617 pub fn on_value_changed(mut self, callback: impl IntoPayloadCallback<Option<f64>>) -> Self {
1618 self.on_value_changed = Some(callback.into_payload_callback());
1619 self
1620 }
1621 }
1622 impl sealed::Sealed for NumberBox {}
1623 impl sealed::NativeControl for NumberBox {
1624 fn into_element(self) -> Element {
1625 self.into()
1626 }
1627 }
1628 impl crate::reference::sealed::Sealed for NumberBox {}
1629 impl crate::reference::ReferenceControl for NumberBox {}
1630 impl sealed::LayoutControl for NumberBox {
1631 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
1632 &mut self.element_state
1633 }
1634 }
1635 impl LayoutControl for NumberBox {}
1636 impl FocusControl for NumberBox {}
1637 #[non_exhaustive]
1638 #[repr(u8)]
1639 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
1640 pub enum NumberBoxSlot {
1641 Header,
1642 }
1643 impl sealed::SlotIndex<NumberBoxSlot> for NumberBox {
1644 fn slot_index(slot: NumberBoxSlot) -> u8 {
1645 slot as u8
1646 }
1647 }
1648 impl SlotsControl for NumberBox {
1649 type Slot = NumberBoxSlot;
1650 }
1651 #[derive(Clone, Debug, Default, PartialEq)]
1652 pub struct Slider {
1653 minimum: Property<f64>,
1654 maximum: Property<f64>,
1655 value: Property<f64>,
1656 is_enabled: Property<bool>,
1657 step_frequency: Property<f64>,
1658 orientation: Property<Orientation>,
1659 on_value_changed: Option<Callback<f64>>,
1660 reference: Option<NativeElementRef>,
1661 element_state: Option<std::rc::Rc<ElementState>>,
1662 }
1663 impl Slider {
1664 pub fn new() -> Self {
1665 Self::default()
1666 }
1667 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
1668 self.reference = Some(reference.binding());
1669 self
1670 }
1671 pub fn minimum(mut self, value: impl Into<Option<f64>>) -> Self {
1672 let value = value.into();
1673 self.minimum = Property::from(value);
1674 self
1675 }
1676 pub fn maximum(mut self, value: impl Into<Option<f64>>) -> Self {
1677 let value = value.into();
1678 self.maximum = Property::from(value);
1679 self
1680 }
1681 pub fn value(mut self, value: impl Into<Option<f64>>) -> Self {
1682 let value = value.into();
1683 self.value = Property::from(value);
1684 self
1685 }
1686 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
1687 let value = value.into();
1688 self.is_enabled = Property::from(value);
1689 self
1690 }
1691 pub fn step_frequency(mut self, value: impl Into<Option<f64>>) -> Self {
1692 let value = value.into();
1693 assert!(
1694 value
1695 .as_ref()
1696 .is_none_or(|value| value.is_finite() && *value > 0.0),
1697 "Slider StepFrequency must be finite and positive",
1698 );
1699 self.step_frequency = Property::from(value);
1700 self
1701 }
1702 pub fn orientation(mut self, value: impl Into<Option<Orientation>>) -> Self {
1703 let value = value.into();
1704 self.orientation = Property::from(value);
1705 self
1706 }
1707 pub fn on_value_changed(mut self, callback: impl IntoPayloadCallback<f64>) -> Self {
1708 self.on_value_changed = Some(callback.into_payload_callback());
1709 self
1710 }
1711 }
1712 impl sealed::Sealed for Slider {}
1713 impl sealed::NativeControl for Slider {
1714 fn into_element(self) -> Element {
1715 self.into()
1716 }
1717 }
1718 impl crate::reference::sealed::Sealed for Slider {}
1719 impl crate::reference::ReferenceControl for Slider {}
1720 impl sealed::LayoutControl for Slider {
1721 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
1722 &mut self.element_state
1723 }
1724 }
1725 impl LayoutControl for Slider {}
1726 impl FocusControl for Slider {}
1727 #[non_exhaustive]
1728 #[repr(u8)]
1729 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
1730 pub enum SliderSlot {
1731 Header,
1732 }
1733 impl sealed::SlotIndex<SliderSlot> for Slider {
1734 fn slot_index(slot: SliderSlot) -> u8 {
1735 slot as u8
1736 }
1737 }
1738 impl SlotsControl for Slider {
1739 type Slot = SliderSlot;
1740 }
1741 #[derive(Clone, Debug, Default, PartialEq)]
1742 pub struct TitleBar {
1743 title: Property<String>,
1744 subtitle: Property<String>,
1745 is_back_button_visible: Property<bool>,
1746 is_back_button_enabled: Property<bool>,
1747 is_pane_toggle_button_visible: Property<bool>,
1748 events: Option<std::rc::Rc<TitleBarEvents>>,
1749 element_state: Option<std::rc::Rc<ElementState>>,
1750 preferred_height: WindowTitleBarHeight,
1751 }
1752 impl TitleBar {
1753 pub fn new() -> Self {
1754 Self::default()
1755 }
1756 pub fn preferred_height(mut self, height: WindowTitleBarHeight) -> Self {
1757 self.preferred_height = height;
1758 self
1759 }
1760 pub fn title(mut self, value: impl Into<String>) -> Self {
1761 self.title = Property::Set(value.into());
1762 self
1763 }
1764 pub fn title_optional<T>(mut self, value: Option<T>) -> Self
1765 where
1766 T: Into<String>,
1767 {
1768 self.title = Property::from(value.map(Into::into));
1769 self
1770 }
1771 pub fn subtitle(mut self, value: impl Into<String>) -> Self {
1772 self.subtitle = Property::Set(value.into());
1773 self
1774 }
1775 pub fn subtitle_optional<T>(mut self, value: Option<T>) -> Self
1776 where
1777 T: Into<String>,
1778 {
1779 self.subtitle = Property::from(value.map(Into::into));
1780 self
1781 }
1782 pub fn is_back_button_visible(mut self, value: impl Into<Option<bool>>) -> Self {
1783 let value = value.into();
1784 self.is_back_button_visible = Property::from(value);
1785 self
1786 }
1787 pub fn is_back_button_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
1788 let value = value.into();
1789 self.is_back_button_enabled = Property::from(value);
1790 self
1791 }
1792 pub fn is_pane_toggle_button_visible(mut self, value: impl Into<Option<bool>>) -> Self {
1793 let value = value.into();
1794 self.is_pane_toggle_button_visible = Property::from(value);
1795 self
1796 }
1797 pub fn on_back_requested(mut self, callback: impl IntoUnitCallback) -> Self {
1798 std::rc::Rc::make_mut(
1799 self.events
1800 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
1801 )
1802 .on_back_requested = Some(callback.into_unit_callback());
1803 self
1804 }
1805 pub fn on_pane_toggle_requested(mut self, callback: impl IntoUnitCallback) -> Self {
1806 std::rc::Rc::make_mut(
1807 self.events
1808 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
1809 )
1810 .on_pane_toggle_requested = Some(callback.into_unit_callback());
1811 self
1812 }
1813 }
1814 impl sealed::Sealed for TitleBar {}
1815 impl sealed::NativeControl for TitleBar {
1816 fn into_element(self) -> Element {
1817 self.into()
1818 }
1819 }
1820 impl sealed::LayoutControl for TitleBar {
1821 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
1822 &mut self.element_state
1823 }
1824 }
1825 impl LayoutControl for TitleBar {}
1826 #[non_exhaustive]
1827 #[repr(u8)]
1828 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
1829 pub enum TitleBarSlot {
1830 Content,
1831 RightHeader,
1832 }
1833 impl sealed::SlotIndex<TitleBarSlot> for TitleBar {
1834 fn slot_index(slot: TitleBarSlot) -> u8 {
1835 slot as u8
1836 }
1837 }
1838 impl SlotsControl for TitleBar {
1839 type Slot = TitleBarSlot;
1840 }
1841 #[derive(Clone, Debug, Default, PartialEq)]
1842 pub struct NavigationView {
1843 is_enabled: Property<bool>,
1844 pane_display_mode: Property<NavigationViewPaneDisplayMode>,
1845 is_pane_toggle_button_visible: Property<bool>,
1846 is_back_button_visible: Property<NavigationViewBackButtonVisible>,
1847 is_settings_visible: Property<bool>,
1848 always_show_header: Property<bool>,
1849 pane_title: Property<String>,
1850 open_pane_length: Property<f64>,
1851 is_pane_open: Property<bool>,
1852 events: Option<std::rc::Rc<NavigationViewEvents>>,
1853 element_state: Option<std::rc::Rc<ElementState>>,
1854 }
1855 impl NavigationView {
1856 pub fn new() -> Self {
1857 Self::default()
1858 }
1859 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
1860 let value = value.into();
1861 self.is_enabled = Property::from(value);
1862 self
1863 }
1864 pub fn pane_display_mode(
1865 mut self,
1866 value: impl Into<Option<NavigationViewPaneDisplayMode>>,
1867 ) -> Self {
1868 let value = value.into();
1869 self.pane_display_mode = Property::from(value);
1870 self
1871 }
1872 pub fn is_pane_toggle_button_visible(mut self, value: impl Into<Option<bool>>) -> Self {
1873 let value = value.into();
1874 self.is_pane_toggle_button_visible = Property::from(value);
1875 self
1876 }
1877 pub fn is_back_button_visible(
1878 mut self,
1879 value: impl Into<Option<NavigationViewBackButtonVisible>>,
1880 ) -> Self {
1881 let value = value.into();
1882 self.is_back_button_visible = Property::from(value);
1883 self
1884 }
1885 pub fn is_settings_visible(mut self, value: impl Into<Option<bool>>) -> Self {
1886 let value = value.into();
1887 self.is_settings_visible = Property::from(value);
1888 self
1889 }
1890 pub fn always_show_header(mut self, value: impl Into<Option<bool>>) -> Self {
1891 let value = value.into();
1892 self.always_show_header = Property::from(value);
1893 self
1894 }
1895 pub fn pane_title(mut self, value: impl Into<String>) -> Self {
1896 self.pane_title = Property::Set(value.into());
1897 self
1898 }
1899 pub fn pane_title_optional<T>(mut self, value: Option<T>) -> Self
1900 where
1901 T: Into<String>,
1902 {
1903 self.pane_title = Property::from(value.map(Into::into));
1904 self
1905 }
1906 pub fn open_pane_length(mut self, value: impl Into<Option<f64>>) -> Self {
1907 let value = value.into();
1908 assert!(
1909 value
1910 .as_ref()
1911 .is_none_or(|value| value.is_finite() && *value >= 0.0),
1912 "NavigationView OpenPaneLength must contain finite non-negative values",
1913 );
1914 self.open_pane_length = Property::from(value);
1915 self
1916 }
1917 pub fn is_pane_open(mut self, value: impl Into<Option<bool>>) -> Self {
1918 let value = value.into();
1919 self.is_pane_open = Property::from(value);
1920 self
1921 }
1922 pub fn on_is_pane_open_changed(mut self, callback: impl IntoPayloadCallback<bool>) -> Self {
1923 std::rc::Rc::make_mut(
1924 self.events
1925 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
1926 )
1927 .on_is_pane_open_changed = Some(callback.into_payload_callback());
1928 self
1929 }
1930 pub fn on_display_mode_changed(
1931 mut self,
1932 callback: impl IntoPayloadCallback<NavigationViewDisplayMode>,
1933 ) -> Self {
1934 std::rc::Rc::make_mut(
1935 self.events
1936 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
1937 )
1938 .on_display_mode_changed = Some(callback.into_payload_callback());
1939 self
1940 }
1941 pub fn on_selected_tag_changed(
1942 mut self,
1943 callback: impl IntoPayloadCallback<Option<String>>,
1944 ) -> Self {
1945 std::rc::Rc::make_mut(
1946 self.events
1947 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
1948 )
1949 .on_selected_tag_changed = Some(callback.into_payload_callback());
1950 self
1951 }
1952 }
1953 impl sealed::Sealed for NavigationView {}
1954 impl sealed::NativeControl for NavigationView {
1955 fn into_element(self) -> Element {
1956 self.into()
1957 }
1958 }
1959 impl sealed::LayoutControl for NavigationView {
1960 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
1961 &mut self.element_state
1962 }
1963 }
1964 impl LayoutControl for NavigationView {}
1965 #[non_exhaustive]
1966 #[repr(u8)]
1967 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
1968 pub enum NavigationViewSlot {
1969 Content,
1970 Header,
1971 PaneCustomContent,
1972 PaneFooter,
1973 MenuItems,
1974 }
1975 impl sealed::SlotIndex<NavigationViewSlot> for NavigationView {
1976 fn slot_index(slot: NavigationViewSlot) -> u8 {
1977 slot as u8
1978 }
1979 }
1980 impl SlotsControl for NavigationView {
1981 type Slot = NavigationViewSlot;
1982 }
1983 #[derive(Clone, Debug, Default, PartialEq)]
1984 pub struct NavigationViewItem {
1985 tag: Property<String>,
1986 is_selected: Property<bool>,
1987 selects_on_invoked: Property<bool>,
1988 is_expanded: Property<bool>,
1989 element_state: Option<std::rc::Rc<ElementState>>,
1990 }
1991 impl NavigationViewItem {
1992 pub fn new() -> Self {
1993 Self::default()
1994 }
1995 pub fn tag(mut self, value: impl Into<String>) -> Self {
1996 self.tag = Property::Set(value.into());
1997 self
1998 }
1999 pub fn tag_optional<T>(mut self, value: Option<T>) -> Self
2000 where
2001 T: Into<String>,
2002 {
2003 self.tag = Property::from(value.map(Into::into));
2004 self
2005 }
2006 pub fn is_selected(mut self, value: impl Into<Option<bool>>) -> Self {
2007 let value = value.into();
2008 self.is_selected = Property::from(value);
2009 self
2010 }
2011 pub fn selects_on_invoked(mut self, value: impl Into<Option<bool>>) -> Self {
2012 let value = value.into();
2013 self.selects_on_invoked = Property::from(value);
2014 self
2015 }
2016 pub fn is_expanded(mut self, value: impl Into<Option<bool>>) -> Self {
2017 let value = value.into();
2018 self.is_expanded = Property::from(value);
2019 self
2020 }
2021 }
2022 impl sealed::Sealed for NavigationViewItem {}
2023 impl sealed::NativeControl for NavigationViewItem {
2024 fn into_element(self) -> Element {
2025 self.into()
2026 }
2027 }
2028 impl sealed::LayoutControl for NavigationViewItem {
2029 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2030 &mut self.element_state
2031 }
2032 }
2033 impl LayoutControl for NavigationViewItem {}
2034 #[non_exhaustive]
2035 #[repr(u8)]
2036 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
2037 pub enum NavigationViewItemSlot {
2038 Content,
2039 Icon,
2040 MenuItems,
2041 }
2042 impl sealed::SlotIndex<NavigationViewItemSlot> for NavigationViewItem {
2043 fn slot_index(slot: NavigationViewItemSlot) -> u8 {
2044 slot as u8
2045 }
2046 }
2047 impl SlotsControl for NavigationViewItem {
2048 type Slot = NavigationViewItemSlot;
2049 }
2050 #[derive(Clone, Debug, Default, PartialEq)]
2051 pub struct SplitView {
2052 open_pane_length: Property<f64>,
2053 compact_pane_length: Property<f64>,
2054 display_mode: Property<SplitViewDisplayMode>,
2055 is_pane_open: Property<bool>,
2056 on_pane_closed: Option<Callback<bool>>,
2057 element_state: Option<std::rc::Rc<ElementState>>,
2058 }
2059 impl SplitView {
2060 pub fn new() -> Self {
2061 Self::default()
2062 }
2063 pub fn open_pane_length(mut self, value: impl Into<Option<f64>>) -> Self {
2064 let value = value.into();
2065 self.open_pane_length = Property::from(value);
2066 self
2067 }
2068 pub fn compact_pane_length(mut self, value: impl Into<Option<f64>>) -> Self {
2069 let value = value.into();
2070 self.compact_pane_length = Property::from(value);
2071 self
2072 }
2073 pub fn display_mode(mut self, value: impl Into<Option<SplitViewDisplayMode>>) -> Self {
2074 let value = value.into();
2075 self.display_mode = Property::from(value);
2076 self
2077 }
2078 pub fn is_pane_open(mut self, value: impl Into<Option<bool>>) -> Self {
2079 let value = value.into();
2080 self.is_pane_open = Property::from(value);
2081 self
2082 }
2083 pub fn on_pane_closed(mut self, callback: impl IntoPayloadCallback<bool>) -> Self {
2084 self.on_pane_closed = Some(callback.into_payload_callback());
2085 self
2086 }
2087 }
2088 impl sealed::Sealed for SplitView {}
2089 impl sealed::NativeControl for SplitView {
2090 fn into_element(self) -> Element {
2091 self.into()
2092 }
2093 }
2094 impl sealed::LayoutControl for SplitView {
2095 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2096 &mut self.element_state
2097 }
2098 }
2099 impl LayoutControl for SplitView {}
2100 #[non_exhaustive]
2101 #[repr(u8)]
2102 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
2103 pub enum SplitViewSlot {
2104 Pane,
2105 Content,
2106 }
2107 impl sealed::SlotIndex<SplitViewSlot> for SplitView {
2108 fn slot_index(slot: SplitViewSlot) -> u8 {
2109 slot as u8
2110 }
2111 }
2112 impl SlotsControl for SplitView {
2113 type Slot = SplitViewSlot;
2114 }
2115 #[derive(Clone, Debug, Default, PartialEq)]
2116 pub struct ProgressBar {
2117 minimum: Property<f64>,
2118 maximum: Property<f64>,
2119 value: Property<f64>,
2120 is_indeterminate: Property<bool>,
2121 show_error: Property<bool>,
2122 show_paused: Property<bool>,
2123 is_enabled: Property<bool>,
2124 element_state: Option<std::rc::Rc<ElementState>>,
2125 }
2126 impl ProgressBar {
2127 pub fn new() -> Self {
2128 Self::default()
2129 }
2130 pub fn minimum(mut self, value: impl Into<Option<f64>>) -> Self {
2131 let value = value.into();
2132 self.minimum = Property::from(value);
2133 self
2134 }
2135 pub fn maximum(mut self, value: impl Into<Option<f64>>) -> Self {
2136 let value = value.into();
2137 self.maximum = Property::from(value);
2138 self
2139 }
2140 pub fn value(mut self, value: impl Into<Option<f64>>) -> Self {
2141 let value = value.into();
2142 self.value = Property::from(value);
2143 self
2144 }
2145 pub fn is_indeterminate(mut self, value: impl Into<Option<bool>>) -> Self {
2146 let value = value.into();
2147 self.is_indeterminate = Property::from(value);
2148 self
2149 }
2150 pub fn show_error(mut self, value: impl Into<Option<bool>>) -> Self {
2151 let value = value.into();
2152 self.show_error = Property::from(value);
2153 self
2154 }
2155 pub fn show_paused(mut self, value: impl Into<Option<bool>>) -> Self {
2156 let value = value.into();
2157 self.show_paused = Property::from(value);
2158 self
2159 }
2160 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
2161 let value = value.into();
2162 self.is_enabled = Property::from(value);
2163 self
2164 }
2165 }
2166 impl sealed::Sealed for ProgressBar {}
2167 impl sealed::NativeControl for ProgressBar {
2168 fn into_element(self) -> Element {
2169 self.into()
2170 }
2171 }
2172 impl sealed::LayoutControl for ProgressBar {
2173 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2174 &mut self.element_state
2175 }
2176 }
2177 impl LayoutControl for ProgressBar {}
2178 #[derive(Clone, Debug, Default, PartialEq)]
2179 pub struct ToggleSwitch {
2180 is_on: Property<bool>,
2181 is_enabled: Property<bool>,
2182 on_toggled: Option<Callback<bool>>,
2183 reference: Option<NativeElementRef>,
2184 element_state: Option<std::rc::Rc<ElementState>>,
2185 }
2186 impl ToggleSwitch {
2187 pub fn new() -> Self {
2188 Self::default()
2189 }
2190 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
2191 self.reference = Some(reference.binding());
2192 self
2193 }
2194 pub fn is_on(mut self, value: impl Into<Option<bool>>) -> Self {
2195 let value = value.into();
2196 self.is_on = Property::from(value);
2197 self
2198 }
2199 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
2200 let value = value.into();
2201 self.is_enabled = Property::from(value);
2202 self
2203 }
2204 pub fn on_toggled(mut self, callback: impl IntoPayloadCallback<bool>) -> Self {
2205 self.on_toggled = Some(callback.into_payload_callback());
2206 self
2207 }
2208 }
2209 impl sealed::Sealed for ToggleSwitch {}
2210 impl sealed::NativeControl for ToggleSwitch {
2211 fn into_element(self) -> Element {
2212 self.into()
2213 }
2214 }
2215 impl crate::reference::sealed::Sealed for ToggleSwitch {}
2216 impl crate::reference::ReferenceControl for ToggleSwitch {}
2217 impl sealed::LayoutControl for ToggleSwitch {
2218 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2219 &mut self.element_state
2220 }
2221 }
2222 impl LayoutControl for ToggleSwitch {}
2223 impl FocusControl for ToggleSwitch {}
2224 #[non_exhaustive]
2225 #[repr(u8)]
2226 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
2227 pub enum ToggleSwitchSlot {
2228 Header,
2229 OnContent,
2230 OffContent,
2231 }
2232 impl sealed::SlotIndex<ToggleSwitchSlot> for ToggleSwitch {
2233 fn slot_index(slot: ToggleSwitchSlot) -> u8 {
2234 slot as u8
2235 }
2236 }
2237 impl SlotsControl for ToggleSwitch {
2238 type Slot = ToggleSwitchSlot;
2239 }
2240 #[derive(Clone, Debug, Default, PartialEq)]
2241 pub struct CheckBox {
2242 is_checked: Property<bool>,
2243 is_enabled: Property<bool>,
2244 on_is_checked_changed: Option<Callback<bool>>,
2245 reference: Option<NativeElementRef>,
2246 element_state: Option<std::rc::Rc<ElementState>>,
2247 content: Option<Box<Element>>,
2248 }
2249 impl CheckBox {
2250 pub fn new() -> Self {
2251 Self::default()
2252 }
2253 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
2254 self.reference = Some(reference.binding());
2255 self
2256 }
2257 pub fn is_checked(mut self, value: impl Into<Option<bool>>) -> Self {
2258 let value = value.into();
2259 self.is_checked = Property::from(value);
2260 self
2261 }
2262 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
2263 let value = value.into();
2264 self.is_enabled = Property::from(value);
2265 self
2266 }
2267 pub fn on_is_checked_changed(mut self, callback: impl IntoPayloadCallback<bool>) -> Self {
2268 self.on_is_checked_changed = Some(callback.into_payload_callback());
2269 self
2270 }
2271 }
2272 impl sealed::Sealed for CheckBox {}
2273 impl sealed::NativeControl for CheckBox {
2274 fn into_element(self) -> Element {
2275 self.into()
2276 }
2277 }
2278 impl crate::reference::sealed::Sealed for CheckBox {}
2279 impl crate::reference::ReferenceControl for CheckBox {}
2280 impl sealed::LayoutControl for CheckBox {
2281 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2282 &mut self.element_state
2283 }
2284 }
2285 impl LayoutControl for CheckBox {}
2286 impl sealed::ContentControl for CheckBox {}
2287 impl ContentControl for CheckBox {}
2288 impl FocusControl for CheckBox {}
2289 #[cfg(test)]
2290 impl NativeContentTestExt for CheckBox {
2291 fn native_content(mut self, content: impl Into<Element>) -> Self {
2292 self.content = Some(Box::new(content.into()));
2293 self
2294 }
2295 }
2296 #[derive(Clone, Debug, Default, PartialEq)]
2297 pub struct ToggleButton {
2298 is_checked: Property<bool>,
2299 is_enabled: Property<bool>,
2300 on_is_checked_changed: Option<Callback<bool>>,
2301 reference: Option<NativeElementRef>,
2302 element_state: Option<std::rc::Rc<ElementState>>,
2303 content: Option<Box<Element>>,
2304 }
2305 impl ToggleButton {
2306 pub fn new() -> Self {
2307 Self::default()
2308 }
2309 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
2310 self.reference = Some(reference.binding());
2311 self
2312 }
2313 pub fn is_checked(mut self, value: impl Into<Option<bool>>) -> Self {
2314 let value = value.into();
2315 self.is_checked = Property::from(value);
2316 self
2317 }
2318 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
2319 let value = value.into();
2320 self.is_enabled = Property::from(value);
2321 self
2322 }
2323 pub fn on_is_checked_changed(mut self, callback: impl IntoPayloadCallback<bool>) -> Self {
2324 self.on_is_checked_changed = Some(callback.into_payload_callback());
2325 self
2326 }
2327 }
2328 impl sealed::Sealed for ToggleButton {}
2329 impl sealed::NativeControl for ToggleButton {
2330 fn into_element(self) -> Element {
2331 self.into()
2332 }
2333 }
2334 impl crate::reference::sealed::Sealed for ToggleButton {}
2335 impl crate::reference::ReferenceControl for ToggleButton {}
2336 impl sealed::LayoutControl for ToggleButton {
2337 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2338 &mut self.element_state
2339 }
2340 }
2341 impl LayoutControl for ToggleButton {}
2342 impl sealed::ContentControl for ToggleButton {}
2343 impl ContentControl for ToggleButton {}
2344 impl FocusControl for ToggleButton {}
2345 #[cfg(test)]
2346 impl NativeContentTestExt for ToggleButton {
2347 fn native_content(mut self, content: impl Into<Element>) -> Self {
2348 self.content = Some(Box::new(content.into()));
2349 self
2350 }
2351 }
2352 #[derive(Clone, Debug, Default, PartialEq)]
2353 pub struct RadioButton {
2354 group_name: Property<String>,
2355 is_checked: Property<bool>,
2356 is_enabled: Property<bool>,
2357 on_checked: Option<Callback<bool>>,
2358 reference: Option<NativeElementRef>,
2359 element_state: Option<std::rc::Rc<ElementState>>,
2360 content: Option<Box<Element>>,
2361 }
2362 impl RadioButton {
2363 pub fn new() -> Self {
2364 Self::default()
2365 }
2366 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
2367 self.reference = Some(reference.binding());
2368 self
2369 }
2370 pub fn group_name(mut self, value: impl Into<String>) -> Self {
2371 self.group_name = Property::Set(value.into());
2372 self
2373 }
2374 pub fn group_name_optional<T>(mut self, value: Option<T>) -> Self
2375 where
2376 T: Into<String>,
2377 {
2378 self.group_name = Property::from(value.map(Into::into));
2379 self
2380 }
2381 pub fn is_checked(mut self, value: impl Into<Option<bool>>) -> Self {
2382 let value = value.into();
2383 self.is_checked = Property::from(value);
2384 self
2385 }
2386 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
2387 let value = value.into();
2388 self.is_enabled = Property::from(value);
2389 self
2390 }
2391 pub fn on_checked(mut self, callback: impl IntoPayloadCallback<bool>) -> Self {
2392 self.on_checked = Some(callback.into_payload_callback());
2393 self
2394 }
2395 }
2396 impl sealed::Sealed for RadioButton {}
2397 impl sealed::NativeControl for RadioButton {
2398 fn into_element(self) -> Element {
2399 self.into()
2400 }
2401 }
2402 impl crate::reference::sealed::Sealed for RadioButton {}
2403 impl crate::reference::ReferenceControl for RadioButton {}
2404 impl sealed::LayoutControl for RadioButton {
2405 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2406 &mut self.element_state
2407 }
2408 }
2409 impl LayoutControl for RadioButton {}
2410 impl sealed::ContentControl for RadioButton {}
2411 impl ContentControl for RadioButton {}
2412 impl FocusControl for RadioButton {}
2413 #[cfg(test)]
2414 impl NativeContentTestExt for RadioButton {
2415 fn native_content(mut self, content: impl Into<Element>) -> Self {
2416 self.content = Some(Box::new(content.into()));
2417 self
2418 }
2419 }
2420 #[derive(Clone, Debug, Default, PartialEq)]
2421 pub struct RadioButtons {
2422 items_source: Property<std::rc::Rc<Vec<String>>>,
2423 selected_index: Property<Option<usize>>,
2424 max_columns: Property<i32>,
2425 on_selection_changed: Option<Callback<Option<usize>>>,
2426 element_state: Option<std::rc::Rc<ElementState>>,
2427 }
2428 impl RadioButtons {
2429 pub fn new() -> Self {
2430 Self::default()
2431 }
2432 pub fn items_source<I, S>(mut self, value: I) -> Self
2433 where
2434 I: IntoIterator<Item = S>,
2435 S: Into<String>,
2436 {
2437 self.items_source = Property::Set(std::rc::Rc::new(
2438 value.into_iter().map(Into::into).collect(),
2439 ));
2440 self
2441 }
2442 pub fn items_source_optional<I, S>(mut self, value: Option<I>) -> Self
2443 where
2444 I: IntoIterator<Item = S>,
2445 S: Into<String>,
2446 {
2447 self.items_source = Property::from(
2448 value.map(|value| std::rc::Rc::new(value.into_iter().map(Into::into).collect())),
2449 );
2450 self
2451 }
2452 pub fn selected_index(mut self, value: impl Into<Option<usize>>) -> Self {
2453 let value = value.into();
2454 self.selected_index = Property::Set(value);
2455 self
2456 }
2457 pub fn max_columns(mut self, value: impl Into<Option<i32>>) -> Self {
2458 let value = value.into();
2459 self.max_columns = Property::from(value);
2460 self
2461 }
2462 pub fn on_selection_changed(
2463 mut self,
2464 callback: impl IntoPayloadCallback<Option<usize>>,
2465 ) -> Self {
2466 self.on_selection_changed = Some(callback.into_payload_callback());
2467 self
2468 }
2469 }
2470 impl sealed::Sealed for RadioButtons {}
2471 impl sealed::NativeControl for RadioButtons {
2472 fn into_element(self) -> Element {
2473 self.into()
2474 }
2475 }
2476 impl sealed::LayoutControl for RadioButtons {
2477 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2478 &mut self.element_state
2479 }
2480 }
2481 impl LayoutControl for RadioButtons {}
2482 #[non_exhaustive]
2483 #[repr(u8)]
2484 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
2485 pub enum RadioButtonsSlot {
2486 Header,
2487 }
2488 impl sealed::SlotIndex<RadioButtonsSlot> for RadioButtons {
2489 fn slot_index(slot: RadioButtonsSlot) -> u8 {
2490 slot as u8
2491 }
2492 }
2493 impl SlotsControl for RadioButtons {
2494 type Slot = RadioButtonsSlot;
2495 }
2496 #[derive(Clone, Debug, Default, PartialEq)]
2497 pub struct ItemsRepeater {
2498 element_state: Option<std::rc::Rc<ElementState>>,
2499 items: VirtualItems,
2500 }
2501 impl ItemsRepeater {
2502 pub fn new() -> Self {
2503 Self::default()
2504 }
2505 pub fn item(mut self, key: impl Into<Key>, item: impl Into<View>) -> Self {
2506 if let VirtualItems::Eager(items) = &mut self.items {
2507 std::rc::Rc::make_mut(items).push(KeyedView::new(key, item));
2508 } else {
2509 self.items = VirtualItems::Eager(std::rc::Rc::new(vec![KeyedView::new(key, item)]));
2510 }
2511 self
2512 }
2513 pub fn items<T>(mut self, items: impl IntoIterator<Item = T>) -> Self
2514 where
2515 T: Into<KeyedView>,
2516 {
2517 self.items = VirtualItems::Eager(std::rc::Rc::new(
2518 items.into_iter().map(Into::into).collect(),
2519 ));
2520 self
2521 }
2522 #[doc = r" Uses an indexed source that constructs views only for realized items."]
2523 pub fn virtual_source(mut self, source: VirtualSource) -> Self {
2524 self.items = VirtualItems::Lazy(source);
2525 self
2526 }
2527 }
2528 impl sealed::Sealed for ItemsRepeater {}
2529 impl sealed::NativeControl for ItemsRepeater {
2530 fn into_element(self) -> Element {
2531 self.into()
2532 }
2533 }
2534 impl sealed::LayoutControl for ItemsRepeater {
2535 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2536 &mut self.element_state
2537 }
2538 }
2539 impl LayoutControl for ItemsRepeater {}
2540 #[derive(Clone, Debug, Default, PartialEq)]
2541 pub struct InfoBadge {
2542 value: Property<i32>,
2543 element_state: Option<std::rc::Rc<ElementState>>,
2544 }
2545 impl InfoBadge {
2546 pub fn new() -> Self {
2547 Self::default()
2548 }
2549 pub fn value(mut self, value: impl Into<Option<i32>>) -> Self {
2550 let value = value.into();
2551 self.value = Property::from(value);
2552 self
2553 }
2554 }
2555 impl sealed::Sealed for InfoBadge {}
2556 impl sealed::NativeControl for InfoBadge {
2557 fn into_element(self) -> Element {
2558 self.into()
2559 }
2560 }
2561 impl sealed::LayoutControl for InfoBadge {
2562 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2563 &mut self.element_state
2564 }
2565 }
2566 impl LayoutControl for InfoBadge {}
2567 #[derive(Clone, Debug, Default, PartialEq)]
2568 pub struct InfoBar {
2569 title: Property<String>,
2570 message: Property<String>,
2571 severity: Property<InfoBarSeverity>,
2572 is_open: Property<bool>,
2573 is_closable: Property<bool>,
2574 on_closed: Option<Callback<()>>,
2575 element_state: Option<std::rc::Rc<ElementState>>,
2576 }
2577 impl InfoBar {
2578 pub fn new() -> Self {
2579 Self::default()
2580 }
2581 pub fn title(mut self, value: impl Into<String>) -> Self {
2582 self.title = Property::Set(value.into());
2583 self
2584 }
2585 pub fn title_optional<T>(mut self, value: Option<T>) -> Self
2586 where
2587 T: Into<String>,
2588 {
2589 self.title = Property::from(value.map(Into::into));
2590 self
2591 }
2592 pub fn message(mut self, value: impl Into<String>) -> Self {
2593 self.message = Property::Set(value.into());
2594 self
2595 }
2596 pub fn message_optional<T>(mut self, value: Option<T>) -> Self
2597 where
2598 T: Into<String>,
2599 {
2600 self.message = Property::from(value.map(Into::into));
2601 self
2602 }
2603 pub fn severity(mut self, value: impl Into<Option<InfoBarSeverity>>) -> Self {
2604 let value = value.into();
2605 self.severity = Property::from(value);
2606 self
2607 }
2608 pub fn is_open(mut self, value: impl Into<Option<bool>>) -> Self {
2609 let value = value.into();
2610 self.is_open = Property::from(value);
2611 self
2612 }
2613 pub fn is_closable(mut self, value: impl Into<Option<bool>>) -> Self {
2614 let value = value.into();
2615 self.is_closable = Property::from(value);
2616 self
2617 }
2618 pub fn on_closed(mut self, callback: impl IntoUnitCallback) -> Self {
2619 self.on_closed = Some(callback.into_unit_callback());
2620 self
2621 }
2622 }
2623 impl sealed::Sealed for InfoBar {}
2624 impl sealed::NativeControl for InfoBar {
2625 fn into_element(self) -> Element {
2626 self.into()
2627 }
2628 }
2629 impl sealed::LayoutControl for InfoBar {
2630 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2631 &mut self.element_state
2632 }
2633 }
2634 impl LayoutControl for InfoBar {}
2635 #[derive(Clone, Debug, Default, PartialEq)]
2636 pub struct PersonPicture {
2637 display_name: Property<String>,
2638 initials: Property<String>,
2639 element_state: Option<std::rc::Rc<ElementState>>,
2640 }
2641 impl PersonPicture {
2642 pub fn new() -> Self {
2643 Self::default()
2644 }
2645 pub fn display_name(mut self, value: impl Into<String>) -> Self {
2646 self.display_name = Property::Set(value.into());
2647 self
2648 }
2649 pub fn display_name_optional<T>(mut self, value: Option<T>) -> Self
2650 where
2651 T: Into<String>,
2652 {
2653 self.display_name = Property::from(value.map(Into::into));
2654 self
2655 }
2656 pub fn initials(mut self, value: impl Into<String>) -> Self {
2657 self.initials = Property::Set(value.into());
2658 self
2659 }
2660 pub fn initials_optional<T>(mut self, value: Option<T>) -> Self
2661 where
2662 T: Into<String>,
2663 {
2664 self.initials = Property::from(value.map(Into::into));
2665 self
2666 }
2667 }
2668 impl sealed::Sealed for PersonPicture {}
2669 impl sealed::NativeControl for PersonPicture {
2670 fn into_element(self) -> Element {
2671 self.into()
2672 }
2673 }
2674 impl sealed::LayoutControl for PersonPicture {
2675 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2676 &mut self.element_state
2677 }
2678 }
2679 impl LayoutControl for PersonPicture {}
2680 #[derive(Clone, Debug, Default, PartialEq)]
2681 pub struct ScrollViewer {
2682 horizontal_scroll_bar_visibility: Property<ScrollBarVisibility>,
2683 vertical_scroll_bar_visibility: Property<ScrollBarVisibility>,
2684 element_state: Option<std::rc::Rc<ElementState>>,
2685 content: Option<Box<Element>>,
2686 }
2687 impl ScrollViewer {
2688 pub fn new() -> Self {
2689 Self::default()
2690 }
2691 pub fn horizontal_scroll_bar_visibility(
2692 mut self,
2693 value: impl Into<Option<ScrollBarVisibility>>,
2694 ) -> Self {
2695 let value = value.into();
2696 self.horizontal_scroll_bar_visibility = Property::from(value);
2697 self
2698 }
2699 pub fn vertical_scroll_bar_visibility(
2700 mut self,
2701 value: impl Into<Option<ScrollBarVisibility>>,
2702 ) -> Self {
2703 let value = value.into();
2704 self.vertical_scroll_bar_visibility = Property::from(value);
2705 self
2706 }
2707 }
2708 impl sealed::Sealed for ScrollViewer {}
2709 impl sealed::NativeControl for ScrollViewer {
2710 fn into_element(self) -> Element {
2711 self.into()
2712 }
2713 }
2714 impl sealed::LayoutControl for ScrollViewer {
2715 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2716 &mut self.element_state
2717 }
2718 }
2719 impl LayoutControl for ScrollViewer {}
2720 impl sealed::ContentControl for ScrollViewer {}
2721 impl ContentControl for ScrollViewer {}
2722 #[cfg(test)]
2723 impl NativeContentTestExt for ScrollViewer {
2724 fn native_content(mut self, content: impl Into<Element>) -> Self {
2725 self.content = Some(Box::new(content.into()));
2726 self
2727 }
2728 }
2729 #[derive(Clone, Debug, Default, PartialEq)]
2730 pub struct ScrollView {
2731 horizontal_scroll_bar_visibility: Property<ScrollingScrollBarVisibility>,
2732 vertical_scroll_bar_visibility: Property<ScrollingScrollBarVisibility>,
2733 element_state: Option<std::rc::Rc<ElementState>>,
2734 content: Option<Box<Element>>,
2735 }
2736 impl ScrollView {
2737 pub fn new() -> Self {
2738 Self::default()
2739 }
2740 pub fn horizontal_scroll_bar_visibility(
2741 mut self,
2742 value: impl Into<Option<ScrollingScrollBarVisibility>>,
2743 ) -> Self {
2744 let value = value.into();
2745 self.horizontal_scroll_bar_visibility = Property::from(value);
2746 self
2747 }
2748 pub fn vertical_scroll_bar_visibility(
2749 mut self,
2750 value: impl Into<Option<ScrollingScrollBarVisibility>>,
2751 ) -> Self {
2752 let value = value.into();
2753 self.vertical_scroll_bar_visibility = Property::from(value);
2754 self
2755 }
2756 }
2757 impl sealed::Sealed for ScrollView {}
2758 impl sealed::NativeControl for ScrollView {
2759 fn into_element(self) -> Element {
2760 self.into()
2761 }
2762 }
2763 impl sealed::LayoutControl for ScrollView {
2764 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2765 &mut self.element_state
2766 }
2767 }
2768 impl LayoutControl for ScrollView {}
2769 impl sealed::ContentControl for ScrollView {}
2770 impl ContentControl for ScrollView {}
2771 #[cfg(test)]
2772 impl NativeContentTestExt for ScrollView {
2773 fn native_content(mut self, content: impl Into<Element>) -> Self {
2774 self.content = Some(Box::new(content.into()));
2775 self
2776 }
2777 }
2778 #[derive(Clone, Debug, Default, PartialEq)]
2779 pub struct Image {
2780 source: Property<ImageValue>,
2781 stretch: Property<Stretch>,
2782 events: Option<std::rc::Rc<ImageEvents>>,
2783 reference: Option<NativeElementRef>,
2784 element_state: Option<std::rc::Rc<ElementState>>,
2785 }
2786 impl Image {
2787 pub fn new() -> Self {
2788 Self::default()
2789 }
2790 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
2791 self.reference = Some(reference.binding());
2792 self
2793 }
2794 pub fn source(mut self, value: impl Into<String>) -> windows_core::Result<Self> {
2795 let value = value.into();
2796 validate_image_uri(&value)?;
2797 self.source = Property::Set(ImageValue::Uri(value));
2798 Ok(self)
2799 }
2800 pub fn source_optional<T>(mut self, value: Option<T>) -> windows_core::Result<Self>
2801 where
2802 T: Into<String>,
2803 {
2804 self.source = match value {
2805 Some(value) => {
2806 let value = value.into();
2807 validate_image_uri(&value)?;
2808 Property::Set(ImageValue::Uri(value))
2809 }
2810 None => Property::Inherited,
2811 };
2812 Ok(self)
2813 }
2814 pub fn source_file(self, value: impl AsRef<std::path::Path>) -> windows_core::Result<Self> {
2815 self.source(file_uri(value.as_ref())?)
2816 }
2817 pub fn source_data(mut self, value: EncodedImage) -> Self {
2818 self.source = Property::Set(ImageValue::Encoded(value));
2819 self
2820 }
2821 pub fn stretch(mut self, value: impl Into<Option<Stretch>>) -> Self {
2822 let value = value.into();
2823 self.stretch = Property::from(value);
2824 self
2825 }
2826 pub fn on_opened(mut self, callback: impl IntoUnitCallback) -> Self {
2827 std::rc::Rc::make_mut(
2828 self.events
2829 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
2830 )
2831 .on_opened = Some(callback.into_unit_callback());
2832 self
2833 }
2834 pub fn on_failed(mut self, callback: impl IntoUnitCallback) -> Self {
2835 std::rc::Rc::make_mut(
2836 self.events
2837 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
2838 )
2839 .on_failed = Some(callback.into_unit_callback());
2840 self
2841 }
2842 }
2843 impl sealed::Sealed for Image {}
2844 impl sealed::NativeControl for Image {
2845 fn into_element(self) -> Element {
2846 self.into()
2847 }
2848 }
2849 impl crate::reference::sealed::Sealed for Image {}
2850 impl crate::reference::ReferenceControl for Image {}
2851 impl sealed::LayoutControl for Image {
2852 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2853 &mut self.element_state
2854 }
2855 }
2856 impl LayoutControl for Image {}
2857 #[derive(Clone, Debug, Default, PartialEq)]
2858 pub struct ProgressRing {
2859 minimum: Property<f64>,
2860 maximum: Property<f64>,
2861 value: Property<f64>,
2862 is_indeterminate: Property<bool>,
2863 is_active: Property<bool>,
2864 is_enabled: Property<bool>,
2865 element_state: Option<std::rc::Rc<ElementState>>,
2866 }
2867 impl ProgressRing {
2868 pub fn new() -> Self {
2869 Self::default()
2870 }
2871 pub fn minimum(mut self, value: impl Into<Option<f64>>) -> Self {
2872 let value = value.into();
2873 self.minimum = Property::from(value);
2874 self
2875 }
2876 pub fn maximum(mut self, value: impl Into<Option<f64>>) -> Self {
2877 let value = value.into();
2878 self.maximum = Property::from(value);
2879 self
2880 }
2881 pub fn value(mut self, value: impl Into<Option<f64>>) -> Self {
2882 let value = value.into();
2883 self.value = Property::from(value);
2884 self
2885 }
2886 pub fn is_indeterminate(mut self, value: impl Into<Option<bool>>) -> Self {
2887 let value = value.into();
2888 self.is_indeterminate = Property::from(value);
2889 self
2890 }
2891 pub fn is_active(mut self, value: impl Into<Option<bool>>) -> Self {
2892 let value = value.into();
2893 self.is_active = Property::from(value);
2894 self
2895 }
2896 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
2897 let value = value.into();
2898 self.is_enabled = Property::from(value);
2899 self
2900 }
2901 }
2902 impl sealed::Sealed for ProgressRing {}
2903 impl sealed::NativeControl for ProgressRing {
2904 fn into_element(self) -> Element {
2905 self.into()
2906 }
2907 }
2908 impl sealed::LayoutControl for ProgressRing {
2909 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2910 &mut self.element_state
2911 }
2912 }
2913 impl LayoutControl for ProgressRing {}
2914 #[derive(Clone, Debug, Default, PartialEq)]
2915 pub struct ListBox {
2916 is_enabled: Property<bool>,
2917 on_selected_tag_changed: Option<Callback<Option<String>>>,
2918 element_state: Option<std::rc::Rc<ElementState>>,
2919 }
2920 impl ListBox {
2921 pub fn new() -> Self {
2922 Self::default()
2923 }
2924 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
2925 let value = value.into();
2926 self.is_enabled = Property::from(value);
2927 self
2928 }
2929 pub fn on_selected_tag_changed(
2930 mut self,
2931 callback: impl IntoPayloadCallback<Option<String>>,
2932 ) -> Self {
2933 self.on_selected_tag_changed = Some(callback.into_payload_callback());
2934 self
2935 }
2936 }
2937 impl sealed::Sealed for ListBox {}
2938 impl sealed::NativeControl for ListBox {
2939 fn into_element(self) -> Element {
2940 self.into()
2941 }
2942 }
2943 impl sealed::LayoutControl for ListBox {
2944 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
2945 &mut self.element_state
2946 }
2947 }
2948 impl LayoutControl for ListBox {}
2949 #[non_exhaustive]
2950 #[repr(u8)]
2951 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
2952 pub enum ListBoxSlot {
2953 Items,
2954 }
2955 impl sealed::SlotIndex<ListBoxSlot> for ListBox {
2956 fn slot_index(slot: ListBoxSlot) -> u8 {
2957 slot as u8
2958 }
2959 }
2960 impl SlotsControl for ListBox {
2961 type Slot = ListBoxSlot;
2962 }
2963 #[derive(Clone, Debug, Default, PartialEq)]
2964 pub struct Rectangle {
2965 fill: Property<Brush>,
2966 stroke: Property<Brush>,
2967 stroke_thickness: Property<f64>,
2968 radius_x: Property<f64>,
2969 radius_y: Property<f64>,
2970 element_state: Option<std::rc::Rc<ElementState>>,
2971 }
2972 impl Rectangle {
2973 pub fn new() -> Self {
2974 Self::default()
2975 }
2976 pub fn fill(mut self, value: impl Into<Brush>) -> Self {
2977 self.fill = Property::Set(value.into());
2978 self
2979 }
2980 pub fn fill_optional<T>(mut self, value: Option<T>) -> Self
2981 where
2982 T: Into<Brush>,
2983 {
2984 self.fill = Property::from(value.map(Into::into));
2985 self
2986 }
2987 pub fn stroke(mut self, value: impl Into<Brush>) -> Self {
2988 self.stroke = Property::Set(value.into());
2989 self
2990 }
2991 pub fn stroke_optional<T>(mut self, value: Option<T>) -> Self
2992 where
2993 T: Into<Brush>,
2994 {
2995 self.stroke = Property::from(value.map(Into::into));
2996 self
2997 }
2998 pub fn stroke_thickness(mut self, value: impl Into<Option<f64>>) -> Self {
2999 let value = value.into();
3000 assert!(
3001 value
3002 .as_ref()
3003 .is_none_or(|value| value.is_finite() && *value >= 0.0),
3004 "Rectangle StrokeThickness must contain finite non-negative values",
3005 );
3006 self.stroke_thickness = Property::from(value);
3007 self
3008 }
3009 pub fn radius_x(mut self, value: impl Into<Option<f64>>) -> Self {
3010 let value = value.into();
3011 assert!(
3012 value
3013 .as_ref()
3014 .is_none_or(|value| value.is_finite() && *value >= 0.0),
3015 "Rectangle RadiusX must contain finite non-negative values",
3016 );
3017 self.radius_x = Property::from(value);
3018 self
3019 }
3020 pub fn radius_y(mut self, value: impl Into<Option<f64>>) -> Self {
3021 let value = value.into();
3022 assert!(
3023 value
3024 .as_ref()
3025 .is_none_or(|value| value.is_finite() && *value >= 0.0),
3026 "Rectangle RadiusY must contain finite non-negative values",
3027 );
3028 self.radius_y = Property::from(value);
3029 self
3030 }
3031 }
3032 impl sealed::Sealed for Rectangle {}
3033 impl sealed::NativeControl for Rectangle {
3034 fn into_element(self) -> Element {
3035 self.into()
3036 }
3037 }
3038 impl sealed::LayoutControl for Rectangle {
3039 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3040 &mut self.element_state
3041 }
3042 }
3043 impl LayoutControl for Rectangle {}
3044 #[derive(Clone, Debug, Default, PartialEq)]
3045 pub struct Ellipse {
3046 fill: Property<Brush>,
3047 stroke: Property<Brush>,
3048 stroke_thickness: Property<f64>,
3049 element_state: Option<std::rc::Rc<ElementState>>,
3050 }
3051 impl Ellipse {
3052 pub fn new() -> Self {
3053 Self::default()
3054 }
3055 pub fn fill(mut self, value: impl Into<Brush>) -> Self {
3056 self.fill = Property::Set(value.into());
3057 self
3058 }
3059 pub fn fill_optional<T>(mut self, value: Option<T>) -> Self
3060 where
3061 T: Into<Brush>,
3062 {
3063 self.fill = Property::from(value.map(Into::into));
3064 self
3065 }
3066 pub fn stroke(mut self, value: impl Into<Brush>) -> Self {
3067 self.stroke = Property::Set(value.into());
3068 self
3069 }
3070 pub fn stroke_optional<T>(mut self, value: Option<T>) -> Self
3071 where
3072 T: Into<Brush>,
3073 {
3074 self.stroke = Property::from(value.map(Into::into));
3075 self
3076 }
3077 pub fn stroke_thickness(mut self, value: impl Into<Option<f64>>) -> Self {
3078 let value = value.into();
3079 assert!(
3080 value
3081 .as_ref()
3082 .is_none_or(|value| value.is_finite() && *value >= 0.0),
3083 "Ellipse StrokeThickness must contain finite non-negative values",
3084 );
3085 self.stroke_thickness = Property::from(value);
3086 self
3087 }
3088 }
3089 impl sealed::Sealed for Ellipse {}
3090 impl sealed::NativeControl for Ellipse {
3091 fn into_element(self) -> Element {
3092 self.into()
3093 }
3094 }
3095 impl sealed::LayoutControl for Ellipse {
3096 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3097 &mut self.element_state
3098 }
3099 }
3100 impl LayoutControl for Ellipse {}
3101 #[derive(Clone, Debug, Default, PartialEq)]
3102 pub struct Line {
3103 stroke: Property<Brush>,
3104 stroke_thickness: Property<f64>,
3105 x1: Property<f64>,
3106 y1: Property<f64>,
3107 x2: Property<f64>,
3108 y2: Property<f64>,
3109 element_state: Option<std::rc::Rc<ElementState>>,
3110 }
3111 impl Line {
3112 pub fn new() -> Self {
3113 Self::default()
3114 }
3115 pub fn stroke(mut self, value: impl Into<Brush>) -> Self {
3116 self.stroke = Property::Set(value.into());
3117 self
3118 }
3119 pub fn stroke_optional<T>(mut self, value: Option<T>) -> Self
3120 where
3121 T: Into<Brush>,
3122 {
3123 self.stroke = Property::from(value.map(Into::into));
3124 self
3125 }
3126 pub fn stroke_thickness(mut self, value: impl Into<Option<f64>>) -> Self {
3127 let value = value.into();
3128 assert!(
3129 value
3130 .as_ref()
3131 .is_none_or(|value| value.is_finite() && *value >= 0.0),
3132 "Line StrokeThickness must contain finite non-negative values",
3133 );
3134 self.stroke_thickness = Property::from(value);
3135 self
3136 }
3137 pub fn x1(mut self, value: impl Into<Option<f64>>) -> Self {
3138 let value = value.into();
3139 assert!(
3140 value.as_ref().is_none_or(|value| value.is_finite()),
3141 "Line X1 must contain finite values",
3142 );
3143 self.x1 = Property::from(value);
3144 self
3145 }
3146 pub fn y1(mut self, value: impl Into<Option<f64>>) -> Self {
3147 let value = value.into();
3148 assert!(
3149 value.as_ref().is_none_or(|value| value.is_finite()),
3150 "Line Y1 must contain finite values",
3151 );
3152 self.y1 = Property::from(value);
3153 self
3154 }
3155 pub fn x2(mut self, value: impl Into<Option<f64>>) -> Self {
3156 let value = value.into();
3157 assert!(
3158 value.as_ref().is_none_or(|value| value.is_finite()),
3159 "Line X2 must contain finite values",
3160 );
3161 self.x2 = Property::from(value);
3162 self
3163 }
3164 pub fn y2(mut self, value: impl Into<Option<f64>>) -> Self {
3165 let value = value.into();
3166 assert!(
3167 value.as_ref().is_none_or(|value| value.is_finite()),
3168 "Line Y2 must contain finite values",
3169 );
3170 self.y2 = Property::from(value);
3171 self
3172 }
3173 }
3174 impl sealed::Sealed for Line {}
3175 impl sealed::NativeControl for Line {
3176 fn into_element(self) -> Element {
3177 self.into()
3178 }
3179 }
3180 impl sealed::LayoutControl for Line {
3181 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3182 &mut self.element_state
3183 }
3184 }
3185 impl LayoutControl for Line {}
3186 #[derive(Clone, Debug, Default, PartialEq)]
3187 pub struct SymbolIcon {
3188 symbol: Property<Symbol>,
3189 element_state: Option<std::rc::Rc<ElementState>>,
3190 }
3191 impl SymbolIcon {
3192 pub fn new() -> Self {
3193 Self::default()
3194 }
3195 pub fn symbol(mut self, value: impl Into<Option<Symbol>>) -> Self {
3196 let value = value.into();
3197 self.symbol = Property::from(value);
3198 self
3199 }
3200 }
3201 impl sealed::Sealed for SymbolIcon {}
3202 impl sealed::NativeControl for SymbolIcon {
3203 fn into_element(self) -> Element {
3204 self.into()
3205 }
3206 }
3207 impl sealed::LayoutControl for SymbolIcon {
3208 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3209 &mut self.element_state
3210 }
3211 }
3212 impl LayoutControl for SymbolIcon {}
3213 #[derive(Clone, Debug, Default, PartialEq)]
3214 pub struct ImageIcon {
3215 source: Property<ImageValue>,
3216 element_state: Option<std::rc::Rc<ElementState>>,
3217 }
3218 impl ImageIcon {
3219 pub fn new() -> Self {
3220 Self::default()
3221 }
3222 pub fn source(mut self, value: impl Into<String>) -> windows_core::Result<Self> {
3223 let value = value.into();
3224 validate_image_uri(&value)?;
3225 self.source = Property::Set(ImageValue::Uri(value));
3226 Ok(self)
3227 }
3228 pub fn source_optional<T>(mut self, value: Option<T>) -> windows_core::Result<Self>
3229 where
3230 T: Into<String>,
3231 {
3232 self.source = match value {
3233 Some(value) => {
3234 let value = value.into();
3235 validate_image_uri(&value)?;
3236 Property::Set(ImageValue::Uri(value))
3237 }
3238 None => Property::Inherited,
3239 };
3240 Ok(self)
3241 }
3242 pub fn source_file(self, value: impl AsRef<std::path::Path>) -> windows_core::Result<Self> {
3243 self.source(file_uri(value.as_ref())?)
3244 }
3245 pub fn source_data(mut self, value: EncodedImage) -> Self {
3246 self.source = Property::Set(ImageValue::Encoded(value));
3247 self
3248 }
3249 }
3250 impl sealed::Sealed for ImageIcon {}
3251 impl sealed::NativeControl for ImageIcon {
3252 fn into_element(self) -> Element {
3253 self.into()
3254 }
3255 }
3256 impl sealed::LayoutControl for ImageIcon {
3257 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3258 &mut self.element_state
3259 }
3260 }
3261 impl LayoutControl for ImageIcon {}
3262 #[derive(Clone, Debug, Default, PartialEq)]
3263 pub struct FontIcon {
3264 glyph: Property<String>,
3265 element_state: Option<std::rc::Rc<ElementState>>,
3266 }
3267 impl FontIcon {
3268 pub fn new() -> Self {
3269 Self::default()
3270 }
3271 pub fn glyph(mut self, value: impl Into<String>) -> Self {
3272 self.glyph = Property::Set(value.into());
3273 self
3274 }
3275 pub fn glyph_optional<T>(mut self, value: Option<T>) -> Self
3276 where
3277 T: Into<String>,
3278 {
3279 self.glyph = Property::from(value.map(Into::into));
3280 self
3281 }
3282 }
3283 impl sealed::Sealed for FontIcon {}
3284 impl sealed::NativeControl for FontIcon {
3285 fn into_element(self) -> Element {
3286 self.into()
3287 }
3288 }
3289 impl sealed::LayoutControl for FontIcon {
3290 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3291 &mut self.element_state
3292 }
3293 }
3294 impl LayoutControl for FontIcon {}
3295 #[derive(Clone, Debug, Default, PartialEq)]
3296 pub struct BitmapIcon {
3297 uri_source: Property<String>,
3298 show_as_monochrome: Property<bool>,
3299 element_state: Option<std::rc::Rc<ElementState>>,
3300 }
3301 impl BitmapIcon {
3302 pub fn new() -> Self {
3303 Self::default()
3304 }
3305 pub fn uri_source(mut self, value: impl Into<String>) -> windows_core::Result<Self> {
3306 let value = value.into();
3307 validate_uri(&value)?;
3308 self.uri_source = Property::Set(value);
3309 Ok(self)
3310 }
3311 pub fn uri_source_optional<T>(mut self, value: Option<T>) -> windows_core::Result<Self>
3312 where
3313 T: Into<String>,
3314 {
3315 self.uri_source = match value {
3316 Some(value) => {
3317 let value = value.into();
3318 validate_uri(&value)?;
3319 Property::Set(value)
3320 }
3321 None => Property::Inherited,
3322 };
3323 Ok(self)
3324 }
3325 pub fn show_as_monochrome(mut self, value: impl Into<Option<bool>>) -> Self {
3326 let value = value.into();
3327 self.show_as_monochrome = Property::from(value);
3328 self
3329 }
3330 }
3331 impl sealed::Sealed for BitmapIcon {}
3332 impl sealed::NativeControl for BitmapIcon {
3333 fn into_element(self) -> Element {
3334 self.into()
3335 }
3336 }
3337 impl sealed::LayoutControl for BitmapIcon {
3338 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3339 &mut self.element_state
3340 }
3341 }
3342 impl LayoutControl for BitmapIcon {}
3343 #[derive(Clone, Debug, Default, PartialEq)]
3344 pub struct PathIcon {
3345 data: Property<String>,
3346 element_state: Option<std::rc::Rc<ElementState>>,
3347 }
3348 impl PathIcon {
3349 pub fn new() -> Self {
3350 Self::default()
3351 }
3352 pub fn data(mut self, value: impl Into<String>) -> Self {
3353 self.data = Property::Set(value.into());
3354 self
3355 }
3356 pub fn data_optional<T>(mut self, value: Option<T>) -> Self
3357 where
3358 T: Into<String>,
3359 {
3360 self.data = Property::from(value.map(Into::into));
3361 self
3362 }
3363 }
3364 impl sealed::Sealed for PathIcon {}
3365 impl sealed::NativeControl for PathIcon {
3366 fn into_element(self) -> Element {
3367 self.into()
3368 }
3369 }
3370 impl sealed::LayoutControl for PathIcon {
3371 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3372 &mut self.element_state
3373 }
3374 }
3375 impl LayoutControl for PathIcon {}
3376 #[derive(Clone, Debug, Default, PartialEq)]
3377 pub struct ListBoxItem {
3378 tag: Property<String>,
3379 is_selected: Property<bool>,
3380 element_state: Option<std::rc::Rc<ElementState>>,
3381 content: Option<Box<Element>>,
3382 }
3383 impl ListBoxItem {
3384 pub fn new() -> Self {
3385 Self::default()
3386 }
3387 pub fn tag(mut self, value: impl Into<String>) -> Self {
3388 self.tag = Property::Set(value.into());
3389 self
3390 }
3391 pub fn tag_optional<T>(mut self, value: Option<T>) -> Self
3392 where
3393 T: Into<String>,
3394 {
3395 self.tag = Property::from(value.map(Into::into));
3396 self
3397 }
3398 pub fn is_selected(mut self, value: impl Into<Option<bool>>) -> Self {
3399 let value = value.into();
3400 self.is_selected = Property::from(value);
3401 self
3402 }
3403 }
3404 impl sealed::Sealed for ListBoxItem {}
3405 impl sealed::NativeControl for ListBoxItem {
3406 fn into_element(self) -> Element {
3407 self.into()
3408 }
3409 }
3410 impl sealed::LayoutControl for ListBoxItem {
3411 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3412 &mut self.element_state
3413 }
3414 }
3415 impl LayoutControl for ListBoxItem {}
3416 impl sealed::ContentControl for ListBoxItem {}
3417 impl ContentControl for ListBoxItem {}
3418 #[cfg(test)]
3419 impl NativeContentTestExt for ListBoxItem {
3420 fn native_content(mut self, content: impl Into<Element>) -> Self {
3421 self.content = Some(Box::new(content.into()));
3422 self
3423 }
3424 }
3425 #[derive(Clone, Debug, Default, PartialEq)]
3426 pub struct RatingControl {
3427 max_rating: Property<i32>,
3428 value: Property<Option<f64>>,
3429 caption: Property<String>,
3430 is_read_only: Property<bool>,
3431 on_value_changed: Option<Callback<Option<f64>>>,
3432 reference: Option<NativeElementRef>,
3433 element_state: Option<std::rc::Rc<ElementState>>,
3434 }
3435 impl RatingControl {
3436 pub fn new() -> Self {
3437 Self::default()
3438 }
3439 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
3440 self.reference = Some(reference.binding());
3441 self
3442 }
3443 pub fn max_rating(mut self, value: impl Into<Option<i32>>) -> Self {
3444 let value = value.into();
3445 self.max_rating = Property::from(value);
3446 self
3447 }
3448 pub fn value(mut self, value: impl Into<Option<f64>>) -> Self {
3449 let value = value.into().filter(|value| *value != -1.0);
3450 self.value = Property::Set(value);
3451 self
3452 }
3453 pub fn caption(mut self, value: impl Into<String>) -> Self {
3454 self.caption = Property::Set(value.into());
3455 self
3456 }
3457 pub fn caption_optional<T>(mut self, value: Option<T>) -> Self
3458 where
3459 T: Into<String>,
3460 {
3461 self.caption = Property::from(value.map(Into::into));
3462 self
3463 }
3464 pub fn is_read_only(mut self, value: impl Into<Option<bool>>) -> Self {
3465 let value = value.into();
3466 self.is_read_only = Property::from(value);
3467 self
3468 }
3469 pub fn on_value_changed(mut self, callback: impl IntoPayloadCallback<Option<f64>>) -> Self {
3470 self.on_value_changed = Some(callback.into_payload_callback());
3471 self
3472 }
3473 }
3474 impl sealed::Sealed for RatingControl {}
3475 impl sealed::NativeControl for RatingControl {
3476 fn into_element(self) -> Element {
3477 self.into()
3478 }
3479 }
3480 impl crate::reference::sealed::Sealed for RatingControl {}
3481 impl crate::reference::ReferenceControl for RatingControl {}
3482 impl sealed::LayoutControl for RatingControl {
3483 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3484 &mut self.element_state
3485 }
3486 }
3487 impl LayoutControl for RatingControl {}
3488 impl FocusControl for RatingControl {}
3489 #[derive(Clone, Debug, Default, PartialEq)]
3490 pub struct Expander {
3491 is_expanded: Property<bool>,
3492 on_is_expanded_changed: Option<Callback<bool>>,
3493 element_state: Option<std::rc::Rc<ElementState>>,
3494 }
3495 impl Expander {
3496 pub fn new() -> Self {
3497 Self::default()
3498 }
3499 pub fn is_expanded(mut self, value: impl Into<Option<bool>>) -> Self {
3500 let value = value.into();
3501 self.is_expanded = Property::from(value);
3502 self
3503 }
3504 pub fn on_is_expanded_changed(mut self, callback: impl IntoPayloadCallback<bool>) -> Self {
3505 self.on_is_expanded_changed = Some(callback.into_payload_callback());
3506 self
3507 }
3508 }
3509 impl sealed::Sealed for Expander {}
3510 impl sealed::NativeControl for Expander {
3511 fn into_element(self) -> Element {
3512 self.into()
3513 }
3514 }
3515 impl sealed::LayoutControl for Expander {
3516 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3517 &mut self.element_state
3518 }
3519 }
3520 impl LayoutControl for Expander {}
3521 #[non_exhaustive]
3522 #[repr(u8)]
3523 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
3524 pub enum ExpanderSlot {
3525 Header,
3526 Content,
3527 }
3528 impl sealed::SlotIndex<ExpanderSlot> for Expander {
3529 fn slot_index(slot: ExpanderSlot) -> u8 {
3530 slot as u8
3531 }
3532 }
3533 impl SlotsControl for Expander {
3534 type Slot = ExpanderSlot;
3535 }
3536 #[derive(Clone, Debug, Default, PartialEq)]
3537 pub struct ComboBox {
3538 items_source: Property<std::rc::Rc<Vec<String>>>,
3539 selected_index: Property<Option<usize>>,
3540 placeholder_text: Property<String>,
3541 is_editable: Property<bool>,
3542 is_enabled: Property<bool>,
3543 on_selection_changed: Option<Callback<Option<usize>>>,
3544 reference: Option<NativeElementRef>,
3545 element_state: Option<std::rc::Rc<ElementState>>,
3546 }
3547 impl ComboBox {
3548 pub fn new() -> Self {
3549 Self::default()
3550 }
3551 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
3552 self.reference = Some(reference.binding());
3553 self
3554 }
3555 pub fn items_source<I, S>(mut self, value: I) -> Self
3556 where
3557 I: IntoIterator<Item = S>,
3558 S: Into<String>,
3559 {
3560 self.items_source = Property::Set(std::rc::Rc::new(
3561 value.into_iter().map(Into::into).collect(),
3562 ));
3563 self
3564 }
3565 pub fn items_source_optional<I, S>(mut self, value: Option<I>) -> Self
3566 where
3567 I: IntoIterator<Item = S>,
3568 S: Into<String>,
3569 {
3570 self.items_source = Property::from(
3571 value.map(|value| std::rc::Rc::new(value.into_iter().map(Into::into).collect())),
3572 );
3573 self
3574 }
3575 pub fn selected_index(mut self, value: impl Into<Option<usize>>) -> Self {
3576 let value = value.into();
3577 self.selected_index = Property::Set(value);
3578 self
3579 }
3580 pub fn placeholder_text(mut self, value: impl Into<String>) -> Self {
3581 self.placeholder_text = Property::Set(value.into());
3582 self
3583 }
3584 pub fn placeholder_text_optional<T>(mut self, value: Option<T>) -> Self
3585 where
3586 T: Into<String>,
3587 {
3588 self.placeholder_text = Property::from(value.map(Into::into));
3589 self
3590 }
3591 pub fn is_editable(mut self, value: impl Into<Option<bool>>) -> Self {
3592 let value = value.into();
3593 self.is_editable = Property::from(value);
3594 self
3595 }
3596 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
3597 let value = value.into();
3598 self.is_enabled = Property::from(value);
3599 self
3600 }
3601 pub fn on_selection_changed(
3602 mut self,
3603 callback: impl IntoPayloadCallback<Option<usize>>,
3604 ) -> Self {
3605 self.on_selection_changed = Some(callback.into_payload_callback());
3606 self
3607 }
3608 }
3609 impl sealed::Sealed for ComboBox {}
3610 impl sealed::NativeControl for ComboBox {
3611 fn into_element(self) -> Element {
3612 self.into()
3613 }
3614 }
3615 impl crate::reference::sealed::Sealed for ComboBox {}
3616 impl crate::reference::ReferenceControl for ComboBox {}
3617 impl sealed::LayoutControl for ComboBox {
3618 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3619 &mut self.element_state
3620 }
3621 }
3622 impl LayoutControl for ComboBox {}
3623 impl FocusControl for ComboBox {}
3624 #[non_exhaustive]
3625 #[repr(u8)]
3626 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
3627 pub enum ComboBoxSlot {
3628 Header,
3629 }
3630 impl sealed::SlotIndex<ComboBoxSlot> for ComboBox {
3631 fn slot_index(slot: ComboBoxSlot) -> u8 {
3632 slot as u8
3633 }
3634 }
3635 impl SlotsControl for ComboBox {
3636 type Slot = ComboBoxSlot;
3637 }
3638 #[derive(Clone, Debug, Default, PartialEq)]
3639 pub struct Pivot {
3640 selected_index: Property<Option<usize>>,
3641 title: Property<String>,
3642 on_selection_changed: Option<Callback<Option<usize>>>,
3643 element_state: Option<std::rc::Rc<ElementState>>,
3644 }
3645 impl Pivot {
3646 pub fn new() -> Self {
3647 Self::default()
3648 }
3649 pub fn selected_index(mut self, value: impl Into<Option<usize>>) -> Self {
3650 let value = value.into();
3651 self.selected_index = Property::Set(value);
3652 self
3653 }
3654 pub fn title(mut self, value: impl Into<String>) -> Self {
3655 self.title = Property::Set(value.into());
3656 self
3657 }
3658 pub fn title_optional<T>(mut self, value: Option<T>) -> Self
3659 where
3660 T: Into<String>,
3661 {
3662 self.title = Property::from(value.map(Into::into));
3663 self
3664 }
3665 pub fn on_selection_changed(
3666 mut self,
3667 callback: impl IntoPayloadCallback<Option<usize>>,
3668 ) -> Self {
3669 self.on_selection_changed = Some(callback.into_payload_callback());
3670 self
3671 }
3672 }
3673 impl sealed::Sealed for Pivot {}
3674 impl sealed::NativeControl for Pivot {
3675 fn into_element(self) -> Element {
3676 self.into()
3677 }
3678 }
3679 impl sealed::LayoutControl for Pivot {
3680 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3681 &mut self.element_state
3682 }
3683 }
3684 impl LayoutControl for Pivot {}
3685 #[non_exhaustive]
3686 #[repr(u8)]
3687 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
3688 pub enum PivotSlot {
3689 Items,
3690 }
3691 impl sealed::SlotIndex<PivotSlot> for Pivot {
3692 fn slot_index(slot: PivotSlot) -> u8 {
3693 slot as u8
3694 }
3695 }
3696 impl SlotsControl for Pivot {
3697 type Slot = PivotSlot;
3698 }
3699 #[derive(Clone, Debug, Default, PartialEq)]
3700 pub struct PivotItem {
3701 header: Property<String>,
3702 element_state: Option<std::rc::Rc<ElementState>>,
3703 content: Option<Box<Element>>,
3704 }
3705 impl PivotItem {
3706 pub fn new() -> Self {
3707 Self::default()
3708 }
3709 pub fn header(mut self, value: impl Into<String>) -> Self {
3710 self.header = Property::Set(value.into());
3711 self
3712 }
3713 pub fn header_optional<T>(mut self, value: Option<T>) -> Self
3714 where
3715 T: Into<String>,
3716 {
3717 self.header = Property::from(value.map(Into::into));
3718 self
3719 }
3720 }
3721 impl sealed::Sealed for PivotItem {}
3722 impl sealed::NativeControl for PivotItem {
3723 fn into_element(self) -> Element {
3724 self.into()
3725 }
3726 }
3727 impl sealed::LayoutControl for PivotItem {
3728 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3729 &mut self.element_state
3730 }
3731 }
3732 impl LayoutControl for PivotItem {}
3733 impl sealed::ContentControl for PivotItem {}
3734 impl ContentControl for PivotItem {}
3735 #[cfg(test)]
3736 impl NativeContentTestExt for PivotItem {
3737 fn native_content(mut self, content: impl Into<Element>) -> Self {
3738 self.content = Some(Box::new(content.into()));
3739 self
3740 }
3741 }
3742 #[derive(Clone, Debug, Default, PartialEq)]
3743 pub struct FlipView {
3744 selected_index: Property<Option<usize>>,
3745 on_selection_changed: Option<Callback<Option<usize>>>,
3746 element_state: Option<std::rc::Rc<ElementState>>,
3747 }
3748 impl FlipView {
3749 pub fn new() -> Self {
3750 Self::default()
3751 }
3752 pub fn selected_index(mut self, value: impl Into<Option<usize>>) -> Self {
3753 let value = value.into();
3754 self.selected_index = Property::Set(value);
3755 self
3756 }
3757 pub fn on_selection_changed(
3758 mut self,
3759 callback: impl IntoPayloadCallback<Option<usize>>,
3760 ) -> Self {
3761 self.on_selection_changed = Some(callback.into_payload_callback());
3762 self
3763 }
3764 }
3765 impl sealed::Sealed for FlipView {}
3766 impl sealed::NativeControl for FlipView {
3767 fn into_element(self) -> Element {
3768 self.into()
3769 }
3770 }
3771 impl sealed::LayoutControl for FlipView {
3772 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3773 &mut self.element_state
3774 }
3775 }
3776 impl LayoutControl for FlipView {}
3777 #[non_exhaustive]
3778 #[repr(u8)]
3779 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
3780 pub enum FlipViewSlot {
3781 Items,
3782 }
3783 impl sealed::SlotIndex<FlipViewSlot> for FlipView {
3784 fn slot_index(slot: FlipViewSlot) -> u8 {
3785 slot as u8
3786 }
3787 }
3788 impl SlotsControl for FlipView {
3789 type Slot = FlipViewSlot;
3790 }
3791 #[derive(Clone, Debug, Default, PartialEq)]
3792 pub struct SelectorBar {
3793 on_selected_text_changed: Option<Callback<Option<String>>>,
3794 element_state: Option<std::rc::Rc<ElementState>>,
3795 }
3796 impl SelectorBar {
3797 pub fn new() -> Self {
3798 Self::default()
3799 }
3800 pub fn on_selected_text_changed(
3801 mut self,
3802 callback: impl IntoPayloadCallback<Option<String>>,
3803 ) -> Self {
3804 self.on_selected_text_changed = Some(callback.into_payload_callback());
3805 self
3806 }
3807 }
3808 impl sealed::Sealed for SelectorBar {}
3809 impl sealed::NativeControl for SelectorBar {
3810 fn into_element(self) -> Element {
3811 self.into()
3812 }
3813 }
3814 impl sealed::LayoutControl for SelectorBar {
3815 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3816 &mut self.element_state
3817 }
3818 }
3819 impl LayoutControl for SelectorBar {}
3820 #[non_exhaustive]
3821 #[repr(u8)]
3822 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
3823 pub enum SelectorBarSlot {
3824 Items,
3825 }
3826 impl sealed::SlotIndex<SelectorBarSlot> for SelectorBar {
3827 fn slot_index(slot: SelectorBarSlot) -> u8 {
3828 slot as u8
3829 }
3830 }
3831 impl SlotsControl for SelectorBar {
3832 type Slot = SelectorBarSlot;
3833 }
3834 #[derive(Clone, Debug, Default, PartialEq)]
3835 pub struct SelectorBarItem {
3836 text: Property<String>,
3837 is_selected: Property<bool>,
3838 element_state: Option<std::rc::Rc<ElementState>>,
3839 }
3840 impl SelectorBarItem {
3841 pub fn new() -> Self {
3842 Self::default()
3843 }
3844 pub fn text(mut self, value: impl Into<String>) -> Self {
3845 self.text = Property::Set(value.into());
3846 self
3847 }
3848 pub fn text_optional<T>(mut self, value: Option<T>) -> Self
3849 where
3850 T: Into<String>,
3851 {
3852 self.text = Property::from(value.map(Into::into));
3853 self
3854 }
3855 pub fn is_selected(mut self, value: impl Into<Option<bool>>) -> Self {
3856 let value = value.into();
3857 self.is_selected = Property::from(value);
3858 self
3859 }
3860 }
3861 impl sealed::Sealed for SelectorBarItem {}
3862 impl sealed::NativeControl for SelectorBarItem {
3863 fn into_element(self) -> Element {
3864 self.into()
3865 }
3866 }
3867 impl sealed::LayoutControl for SelectorBarItem {
3868 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3869 &mut self.element_state
3870 }
3871 }
3872 impl LayoutControl for SelectorBarItem {}
3873 #[non_exhaustive]
3874 #[repr(u8)]
3875 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
3876 pub enum SelectorBarItemSlot {
3877 Icon,
3878 }
3879 impl sealed::SlotIndex<SelectorBarItemSlot> for SelectorBarItem {
3880 fn slot_index(slot: SelectorBarItemSlot) -> u8 {
3881 slot as u8
3882 }
3883 }
3884 impl SlotsControl for SelectorBarItem {
3885 type Slot = SelectorBarItemSlot;
3886 }
3887 #[derive(Clone, Debug, Default, PartialEq)]
3888 pub struct TabView {
3889 selected_index: Property<Option<usize>>,
3890 can_reorder_tabs: Property<bool>,
3891 is_add_tab_button_visible: Property<bool>,
3892 events: Option<std::rc::Rc<TabViewEvents>>,
3893 element_state: Option<std::rc::Rc<ElementState>>,
3894 }
3895 impl TabView {
3896 pub fn new() -> Self {
3897 Self::default()
3898 }
3899 pub fn selected_index(mut self, value: impl Into<Option<usize>>) -> Self {
3900 let value = value.into();
3901 self.selected_index = Property::Set(value);
3902 self
3903 }
3904 pub fn can_reorder_tabs(mut self, value: impl Into<Option<bool>>) -> Self {
3905 let value = value.into();
3906 self.can_reorder_tabs = Property::from(value);
3907 self
3908 }
3909 pub fn is_add_tab_button_visible(mut self, value: impl Into<Option<bool>>) -> Self {
3910 let value = value.into();
3911 self.is_add_tab_button_visible = Property::from(value);
3912 self
3913 }
3914 pub fn on_selection_changed(
3915 mut self,
3916 callback: impl IntoPayloadCallback<Option<usize>>,
3917 ) -> Self {
3918 std::rc::Rc::make_mut(
3919 self.events
3920 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
3921 )
3922 .on_selection_changed = Some(callback.into_payload_callback());
3923 self
3924 }
3925 pub fn on_close_requested(mut self, callback: impl IntoPayloadCallback<String>) -> Self {
3926 std::rc::Rc::make_mut(
3927 self.events
3928 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
3929 )
3930 .on_close_requested = Some(callback.into_payload_callback());
3931 self
3932 }
3933 pub fn on_add_tab_button_click(mut self, callback: impl IntoUnitCallback) -> Self {
3934 std::rc::Rc::make_mut(
3935 self.events
3936 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
3937 )
3938 .on_add_tab_button_click = Some(callback.into_unit_callback());
3939 self
3940 }
3941 pub fn on_reordered(mut self, callback: impl IntoPayloadCallback<Vec<String>>) -> Self {
3942 std::rc::Rc::make_mut(
3943 self.events
3944 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
3945 )
3946 .on_reordered = Some(callback.into_payload_callback());
3947 self
3948 }
3949 }
3950 impl sealed::Sealed for TabView {}
3951 impl sealed::NativeControl for TabView {
3952 fn into_element(self) -> Element {
3953 self.into()
3954 }
3955 }
3956 impl sealed::LayoutControl for TabView {
3957 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
3958 &mut self.element_state
3959 }
3960 }
3961 impl LayoutControl for TabView {}
3962 #[non_exhaustive]
3963 #[repr(u8)]
3964 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
3965 pub enum TabViewSlot {
3966 TabItems,
3967 }
3968 impl sealed::SlotIndex<TabViewSlot> for TabView {
3969 fn slot_index(slot: TabViewSlot) -> u8 {
3970 slot as u8
3971 }
3972 }
3973 impl SlotsControl for TabView {
3974 type Slot = TabViewSlot;
3975 }
3976 #[derive(Clone, Debug, Default, PartialEq)]
3977 pub struct TabViewItem {
3978 header: Property<String>,
3979 is_closable: Property<bool>,
3980 tag: Property<String>,
3981 element_state: Option<std::rc::Rc<ElementState>>,
3982 content: Option<Box<Element>>,
3983 }
3984 impl TabViewItem {
3985 pub fn new() -> Self {
3986 Self::default()
3987 }
3988 pub fn header(mut self, value: impl Into<String>) -> Self {
3989 self.header = Property::Set(value.into());
3990 self
3991 }
3992 pub fn header_optional<T>(mut self, value: Option<T>) -> Self
3993 where
3994 T: Into<String>,
3995 {
3996 self.header = Property::from(value.map(Into::into));
3997 self
3998 }
3999 pub fn is_closable(mut self, value: impl Into<Option<bool>>) -> Self {
4000 let value = value.into();
4001 self.is_closable = Property::from(value);
4002 self
4003 }
4004 pub fn tag(mut self, value: impl Into<String>) -> Self {
4005 self.tag = Property::Set(value.into());
4006 self
4007 }
4008 pub fn tag_optional<T>(mut self, value: Option<T>) -> Self
4009 where
4010 T: Into<String>,
4011 {
4012 self.tag = Property::from(value.map(Into::into));
4013 self
4014 }
4015 }
4016 impl sealed::Sealed for TabViewItem {}
4017 impl sealed::NativeControl for TabViewItem {
4018 fn into_element(self) -> Element {
4019 self.into()
4020 }
4021 }
4022 impl sealed::LayoutControl for TabViewItem {
4023 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4024 &mut self.element_state
4025 }
4026 }
4027 impl LayoutControl for TabViewItem {}
4028 impl sealed::ContentControl for TabViewItem {}
4029 impl ContentControl for TabViewItem {}
4030 #[cfg(test)]
4031 impl NativeContentTestExt for TabViewItem {
4032 fn native_content(mut self, content: impl Into<Element>) -> Self {
4033 self.content = Some(Box::new(content.into()));
4034 self
4035 }
4036 }
4037 #[derive(Clone, Debug, Default, PartialEq)]
4038 pub struct TeachingTip {
4039 title: Property<String>,
4040 subtitle: Property<String>,
4041 is_open: Property<bool>,
4042 is_light_dismiss_enabled: Property<bool>,
4043 preferred_placement: Property<TeachingTipPlacementMode>,
4044 action_button_content: Property<String>,
4045 close_button_content: Property<String>,
4046 events: Option<std::rc::Rc<TeachingTipEvents>>,
4047 element_state: Option<std::rc::Rc<ElementState>>,
4048 }
4049 impl TeachingTip {
4050 pub fn new() -> Self {
4051 Self::default()
4052 }
4053 pub fn title(mut self, value: impl Into<String>) -> Self {
4054 self.title = Property::Set(value.into());
4055 self
4056 }
4057 pub fn title_optional<T>(mut self, value: Option<T>) -> Self
4058 where
4059 T: Into<String>,
4060 {
4061 self.title = Property::from(value.map(Into::into));
4062 self
4063 }
4064 pub fn subtitle(mut self, value: impl Into<String>) -> Self {
4065 self.subtitle = Property::Set(value.into());
4066 self
4067 }
4068 pub fn subtitle_optional<T>(mut self, value: Option<T>) -> Self
4069 where
4070 T: Into<String>,
4071 {
4072 self.subtitle = Property::from(value.map(Into::into));
4073 self
4074 }
4075 pub fn is_open(mut self, value: impl Into<Option<bool>>) -> Self {
4076 let value = value.into();
4077 self.is_open = Property::from(value);
4078 self
4079 }
4080 pub fn is_light_dismiss_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4081 let value = value.into();
4082 self.is_light_dismiss_enabled = Property::from(value);
4083 self
4084 }
4085 pub fn preferred_placement(
4086 mut self,
4087 value: impl Into<Option<TeachingTipPlacementMode>>,
4088 ) -> Self {
4089 let value = value.into();
4090 self.preferred_placement = Property::from(value);
4091 self
4092 }
4093 pub fn action_button_content(mut self, value: impl Into<String>) -> Self {
4094 self.action_button_content = Property::Set(value.into());
4095 self
4096 }
4097 pub fn action_button_content_optional<T>(mut self, value: Option<T>) -> Self
4098 where
4099 T: Into<String>,
4100 {
4101 self.action_button_content = Property::from(value.map(Into::into));
4102 self
4103 }
4104 pub fn close_button_content(mut self, value: impl Into<String>) -> Self {
4105 self.close_button_content = Property::Set(value.into());
4106 self
4107 }
4108 pub fn close_button_content_optional<T>(mut self, value: Option<T>) -> Self
4109 where
4110 T: Into<String>,
4111 {
4112 self.close_button_content = Property::from(value.map(Into::into));
4113 self
4114 }
4115 pub fn on_closed(mut self, callback: impl IntoUnitCallback) -> Self {
4116 std::rc::Rc::make_mut(
4117 self.events
4118 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
4119 )
4120 .on_closed = Some(callback.into_unit_callback());
4121 self
4122 }
4123 pub fn on_action_button_click(mut self, callback: impl IntoUnitCallback) -> Self {
4124 std::rc::Rc::make_mut(
4125 self.events
4126 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
4127 )
4128 .on_action_button_click = Some(callback.into_unit_callback());
4129 self
4130 }
4131 }
4132 impl sealed::Sealed for TeachingTip {}
4133 impl sealed::NativeControl for TeachingTip {
4134 fn into_element(self) -> Element {
4135 self.into()
4136 }
4137 }
4138 impl sealed::LayoutControl for TeachingTip {
4139 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4140 &mut self.element_state
4141 }
4142 }
4143 impl LayoutControl for TeachingTip {}
4144 #[derive(Clone, Debug, Default, PartialEq)]
4145 pub struct DropDownButton {
4146 is_enabled: Property<bool>,
4147 on_click: Option<Callback<()>>,
4148 element_state: Option<std::rc::Rc<ElementState>>,
4149 content: Option<Box<Element>>,
4150 }
4151 impl DropDownButton {
4152 pub fn new() -> Self {
4153 Self::default()
4154 }
4155 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4156 let value = value.into();
4157 self.is_enabled = Property::from(value);
4158 self
4159 }
4160 pub fn on_click(mut self, callback: impl IntoUnitCallback) -> Self {
4161 self.on_click = Some(callback.into_unit_callback());
4162 self
4163 }
4164 }
4165 impl sealed::Sealed for DropDownButton {}
4166 impl sealed::NativeControl for DropDownButton {
4167 fn into_element(self) -> Element {
4168 self.into()
4169 }
4170 }
4171 impl sealed::LayoutControl for DropDownButton {
4172 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4173 &mut self.element_state
4174 }
4175 }
4176 impl LayoutControl for DropDownButton {}
4177 impl sealed::ContentControl for DropDownButton {}
4178 impl ContentControl for DropDownButton {}
4179 #[cfg(test)]
4180 impl NativeContentTestExt for DropDownButton {
4181 fn native_content(mut self, content: impl Into<Element>) -> Self {
4182 self.content = Some(Box::new(content.into()));
4183 self
4184 }
4185 }
4186 #[derive(Clone, Debug, Default, PartialEq)]
4187 pub struct CommandBar {
4188 element_state: Option<std::rc::Rc<ElementState>>,
4189 }
4190 impl CommandBar {
4191 pub fn new() -> Self {
4192 Self::default()
4193 }
4194 }
4195 impl sealed::Sealed for CommandBar {}
4196 impl sealed::NativeControl for CommandBar {
4197 fn into_element(self) -> Element {
4198 self.into()
4199 }
4200 }
4201 impl sealed::LayoutControl for CommandBar {
4202 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4203 &mut self.element_state
4204 }
4205 }
4206 impl LayoutControl for CommandBar {}
4207 #[non_exhaustive]
4208 #[repr(u8)]
4209 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
4210 pub enum CommandBarSlot {
4211 PrimaryCommands,
4212 SecondaryCommands,
4213 }
4214 impl sealed::SlotIndex<CommandBarSlot> for CommandBar {
4215 fn slot_index(slot: CommandBarSlot) -> u8 {
4216 slot as u8
4217 }
4218 }
4219 impl SlotsControl for CommandBar {
4220 type Slot = CommandBarSlot;
4221 }
4222 #[derive(Clone, Debug, Default, PartialEq)]
4223 pub struct AppBarButton {
4224 label: Property<String>,
4225 is_enabled: Property<bool>,
4226 on_click: Option<Callback<()>>,
4227 element_state: Option<std::rc::Rc<ElementState>>,
4228 }
4229 impl AppBarButton {
4230 pub fn new() -> Self {
4231 Self::default()
4232 }
4233 pub fn label(mut self, value: impl Into<String>) -> Self {
4234 self.label = Property::Set(value.into());
4235 self
4236 }
4237 pub fn label_optional<T>(mut self, value: Option<T>) -> Self
4238 where
4239 T: Into<String>,
4240 {
4241 self.label = Property::from(value.map(Into::into));
4242 self
4243 }
4244 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4245 let value = value.into();
4246 self.is_enabled = Property::from(value);
4247 self
4248 }
4249 pub fn on_click(mut self, callback: impl IntoUnitCallback) -> Self {
4250 self.on_click = Some(callback.into_unit_callback());
4251 self
4252 }
4253 }
4254 impl sealed::Sealed for AppBarButton {}
4255 impl sealed::NativeControl for AppBarButton {
4256 fn into_element(self) -> Element {
4257 self.into()
4258 }
4259 }
4260 impl sealed::LayoutControl for AppBarButton {
4261 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4262 &mut self.element_state
4263 }
4264 }
4265 impl LayoutControl for AppBarButton {}
4266 #[non_exhaustive]
4267 #[repr(u8)]
4268 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
4269 pub enum AppBarButtonSlot {
4270 Icon,
4271 }
4272 impl sealed::SlotIndex<AppBarButtonSlot> for AppBarButton {
4273 fn slot_index(slot: AppBarButtonSlot) -> u8 {
4274 slot as u8
4275 }
4276 }
4277 impl SlotsControl for AppBarButton {
4278 type Slot = AppBarButtonSlot;
4279 }
4280 #[derive(Clone, Debug, Default, PartialEq)]
4281 pub struct AppBarSeparator {
4282 element_state: Option<std::rc::Rc<ElementState>>,
4283 }
4284 impl AppBarSeparator {
4285 pub fn new() -> Self {
4286 Self::default()
4287 }
4288 }
4289 impl sealed::Sealed for AppBarSeparator {}
4290 impl sealed::NativeControl for AppBarSeparator {
4291 fn into_element(self) -> Element {
4292 self.into()
4293 }
4294 }
4295 impl sealed::LayoutControl for AppBarSeparator {
4296 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4297 &mut self.element_state
4298 }
4299 }
4300 impl LayoutControl for AppBarSeparator {}
4301 #[derive(Clone, Debug, Default, PartialEq)]
4302 pub struct MenuBar {
4303 element_state: Option<std::rc::Rc<ElementState>>,
4304 }
4305 impl MenuBar {
4306 pub fn new() -> Self {
4307 Self::default()
4308 }
4309 }
4310 impl sealed::Sealed for MenuBar {}
4311 impl sealed::NativeControl for MenuBar {
4312 fn into_element(self) -> Element {
4313 self.into()
4314 }
4315 }
4316 impl sealed::LayoutControl for MenuBar {
4317 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4318 &mut self.element_state
4319 }
4320 }
4321 impl LayoutControl for MenuBar {}
4322 #[non_exhaustive]
4323 #[repr(u8)]
4324 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
4325 pub enum MenuBarSlot {
4326 Items,
4327 }
4328 impl sealed::SlotIndex<MenuBarSlot> for MenuBar {
4329 fn slot_index(slot: MenuBarSlot) -> u8 {
4330 slot as u8
4331 }
4332 }
4333 impl SlotsControl for MenuBar {
4334 type Slot = MenuBarSlot;
4335 }
4336 #[derive(Clone, Debug, Default, PartialEq)]
4337 pub struct MenuBarItem {
4338 title: Property<String>,
4339 element_state: Option<std::rc::Rc<ElementState>>,
4340 }
4341 impl MenuBarItem {
4342 pub fn new() -> Self {
4343 Self::default()
4344 }
4345 pub fn title(mut self, value: impl Into<String>) -> Self {
4346 self.title = Property::Set(value.into());
4347 self
4348 }
4349 pub fn title_optional<T>(mut self, value: Option<T>) -> Self
4350 where
4351 T: Into<String>,
4352 {
4353 self.title = Property::from(value.map(Into::into));
4354 self
4355 }
4356 }
4357 impl sealed::Sealed for MenuBarItem {}
4358 impl sealed::NativeControl for MenuBarItem {
4359 fn into_element(self) -> Element {
4360 self.into()
4361 }
4362 }
4363 impl sealed::LayoutControl for MenuBarItem {
4364 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4365 &mut self.element_state
4366 }
4367 }
4368 impl LayoutControl for MenuBarItem {}
4369 #[derive(Clone, Debug, Default, PartialEq)]
4370 pub struct SplitButton {
4371 is_enabled: Property<bool>,
4372 on_click: Option<Callback<()>>,
4373 element_state: Option<std::rc::Rc<ElementState>>,
4374 content: Option<Box<Element>>,
4375 }
4376 impl SplitButton {
4377 pub fn new() -> Self {
4378 Self::default()
4379 }
4380 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4381 let value = value.into();
4382 self.is_enabled = Property::from(value);
4383 self
4384 }
4385 pub fn on_click(mut self, callback: impl IntoUnitCallback) -> Self {
4386 self.on_click = Some(callback.into_unit_callback());
4387 self
4388 }
4389 }
4390 impl sealed::Sealed for SplitButton {}
4391 impl sealed::NativeControl for SplitButton {
4392 fn into_element(self) -> Element {
4393 self.into()
4394 }
4395 }
4396 impl sealed::LayoutControl for SplitButton {
4397 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4398 &mut self.element_state
4399 }
4400 }
4401 impl LayoutControl for SplitButton {}
4402 impl sealed::ContentControl for SplitButton {}
4403 impl ContentControl for SplitButton {}
4404 #[cfg(test)]
4405 impl NativeContentTestExt for SplitButton {
4406 fn native_content(mut self, content: impl Into<Element>) -> Self {
4407 self.content = Some(Box::new(content.into()));
4408 self
4409 }
4410 }
4411 #[derive(Clone, Debug, Default, PartialEq)]
4412 pub struct ColorPicker {
4413 color: Property<Color>,
4414 is_alpha_enabled: Property<bool>,
4415 is_hex_input_visible: Property<bool>,
4416 is_color_slider_visible: Property<bool>,
4417 is_color_channel_text_input_visible: Property<bool>,
4418 is_enabled: Property<bool>,
4419 on_color_changed: Option<Callback<Color>>,
4420 element_state: Option<std::rc::Rc<ElementState>>,
4421 }
4422 impl ColorPicker {
4423 pub fn new() -> Self {
4424 Self::default()
4425 }
4426 pub fn color(mut self, value: impl Into<Option<Color>>) -> Self {
4427 let value = value.into();
4428 self.color = Property::from(value);
4429 self
4430 }
4431 pub fn is_alpha_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4432 let value = value.into();
4433 self.is_alpha_enabled = Property::from(value);
4434 self
4435 }
4436 pub fn is_hex_input_visible(mut self, value: impl Into<Option<bool>>) -> Self {
4437 let value = value.into();
4438 self.is_hex_input_visible = Property::from(value);
4439 self
4440 }
4441 pub fn is_color_slider_visible(mut self, value: impl Into<Option<bool>>) -> Self {
4442 let value = value.into();
4443 self.is_color_slider_visible = Property::from(value);
4444 self
4445 }
4446 pub fn is_color_channel_text_input_visible(
4447 mut self,
4448 value: impl Into<Option<bool>>,
4449 ) -> Self {
4450 let value = value.into();
4451 self.is_color_channel_text_input_visible = Property::from(value);
4452 self
4453 }
4454 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4455 let value = value.into();
4456 self.is_enabled = Property::from(value);
4457 self
4458 }
4459 pub fn on_color_changed(mut self, callback: impl IntoPayloadCallback<Color>) -> Self {
4460 self.on_color_changed = Some(callback.into_payload_callback());
4461 self
4462 }
4463 }
4464 impl sealed::Sealed for ColorPicker {}
4465 impl sealed::NativeControl for ColorPicker {
4466 fn into_element(self) -> Element {
4467 self.into()
4468 }
4469 }
4470 impl sealed::LayoutControl for ColorPicker {
4471 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4472 &mut self.element_state
4473 }
4474 }
4475 impl LayoutControl for ColorPicker {}
4476 #[derive(Clone, Debug, Default, PartialEq)]
4477 pub struct DatePicker {
4478 day_visible: Property<bool>,
4479 month_visible: Property<bool>,
4480 year_visible: Property<bool>,
4481 is_enabled: Property<bool>,
4482 on_selected_date_changed: Option<Callback<Option<windows_time::DateTime>>>,
4483 element_state: Option<std::rc::Rc<ElementState>>,
4484 }
4485 impl DatePicker {
4486 pub fn new() -> Self {
4487 Self::default()
4488 }
4489 pub fn day_visible(mut self, value: impl Into<Option<bool>>) -> Self {
4490 let value = value.into();
4491 self.day_visible = Property::from(value);
4492 self
4493 }
4494 pub fn month_visible(mut self, value: impl Into<Option<bool>>) -> Self {
4495 let value = value.into();
4496 self.month_visible = Property::from(value);
4497 self
4498 }
4499 pub fn year_visible(mut self, value: impl Into<Option<bool>>) -> Self {
4500 let value = value.into();
4501 self.year_visible = Property::from(value);
4502 self
4503 }
4504 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4505 let value = value.into();
4506 self.is_enabled = Property::from(value);
4507 self
4508 }
4509 pub fn on_selected_date_changed(
4510 mut self,
4511 callback: impl IntoPayloadCallback<Option<windows_time::DateTime>>,
4512 ) -> Self {
4513 self.on_selected_date_changed = Some(callback.into_payload_callback());
4514 self
4515 }
4516 }
4517 impl sealed::Sealed for DatePicker {}
4518 impl sealed::NativeControl for DatePicker {
4519 fn into_element(self) -> Element {
4520 self.into()
4521 }
4522 }
4523 impl sealed::LayoutControl for DatePicker {
4524 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4525 &mut self.element_state
4526 }
4527 }
4528 impl LayoutControl for DatePicker {}
4529 #[non_exhaustive]
4530 #[repr(u8)]
4531 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
4532 pub enum DatePickerSlot {
4533 Header,
4534 }
4535 impl sealed::SlotIndex<DatePickerSlot> for DatePicker {
4536 fn slot_index(slot: DatePickerSlot) -> u8 {
4537 slot as u8
4538 }
4539 }
4540 impl SlotsControl for DatePicker {
4541 type Slot = DatePickerSlot;
4542 }
4543 #[derive(Clone, Debug, Default, PartialEq)]
4544 pub struct TimePicker {
4545 clock_identifier: Property<String>,
4546 minute_increment: Property<i32>,
4547 is_enabled: Property<bool>,
4548 on_selected_time_changed: Option<Callback<Option<windows_time::TimeSpan>>>,
4549 element_state: Option<std::rc::Rc<ElementState>>,
4550 }
4551 impl TimePicker {
4552 pub fn new() -> Self {
4553 Self::default()
4554 }
4555 pub fn clock_identifier(mut self, value: impl Into<String>) -> Self {
4556 self.clock_identifier = Property::Set(value.into());
4557 self
4558 }
4559 pub fn clock_identifier_optional<T>(mut self, value: Option<T>) -> Self
4560 where
4561 T: Into<String>,
4562 {
4563 self.clock_identifier = Property::from(value.map(Into::into));
4564 self
4565 }
4566 pub fn minute_increment(mut self, value: impl Into<Option<i32>>) -> Self {
4567 let value = value.into();
4568 assert!(
4569 value.as_ref().is_none_or(|value| (0..=59).contains(value)),
4570 "TimePicker MinuteIncrement must be between 0 and 59",
4571 );
4572 self.minute_increment = Property::from(value);
4573 self
4574 }
4575 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4576 let value = value.into();
4577 self.is_enabled = Property::from(value);
4578 self
4579 }
4580 pub fn on_selected_time_changed(
4581 mut self,
4582 callback: impl IntoPayloadCallback<Option<windows_time::TimeSpan>>,
4583 ) -> Self {
4584 self.on_selected_time_changed = Some(callback.into_payload_callback());
4585 self
4586 }
4587 }
4588 impl sealed::Sealed for TimePicker {}
4589 impl sealed::NativeControl for TimePicker {
4590 fn into_element(self) -> Element {
4591 self.into()
4592 }
4593 }
4594 impl sealed::LayoutControl for TimePicker {
4595 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4596 &mut self.element_state
4597 }
4598 }
4599 impl LayoutControl for TimePicker {}
4600 #[non_exhaustive]
4601 #[repr(u8)]
4602 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
4603 pub enum TimePickerSlot {
4604 Header,
4605 }
4606 impl sealed::SlotIndex<TimePickerSlot> for TimePicker {
4607 fn slot_index(slot: TimePickerSlot) -> u8 {
4608 slot as u8
4609 }
4610 }
4611 impl SlotsControl for TimePicker {
4612 type Slot = TimePickerSlot;
4613 }
4614 #[derive(Clone, Debug, Default, PartialEq)]
4615 pub struct CalendarDatePicker {
4616 placeholder_text: Property<String>,
4617 is_today_highlighted: Property<bool>,
4618 is_calendar_open: Property<bool>,
4619 is_enabled: Property<bool>,
4620 on_date_changed: Option<Callback<Option<windows_time::DateTime>>>,
4621 element_state: Option<std::rc::Rc<ElementState>>,
4622 }
4623 impl CalendarDatePicker {
4624 pub fn new() -> Self {
4625 Self::default()
4626 }
4627 pub fn placeholder_text(mut self, value: impl Into<String>) -> Self {
4628 self.placeholder_text = Property::Set(value.into());
4629 self
4630 }
4631 pub fn placeholder_text_optional<T>(mut self, value: Option<T>) -> Self
4632 where
4633 T: Into<String>,
4634 {
4635 self.placeholder_text = Property::from(value.map(Into::into));
4636 self
4637 }
4638 pub fn is_today_highlighted(mut self, value: impl Into<Option<bool>>) -> Self {
4639 let value = value.into();
4640 self.is_today_highlighted = Property::from(value);
4641 self
4642 }
4643 pub fn is_calendar_open(mut self, value: impl Into<Option<bool>>) -> Self {
4644 let value = value.into();
4645 self.is_calendar_open = Property::from(value);
4646 self
4647 }
4648 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4649 let value = value.into();
4650 self.is_enabled = Property::from(value);
4651 self
4652 }
4653 pub fn on_date_changed(
4654 mut self,
4655 callback: impl IntoPayloadCallback<Option<windows_time::DateTime>>,
4656 ) -> Self {
4657 self.on_date_changed = Some(callback.into_payload_callback());
4658 self
4659 }
4660 }
4661 impl sealed::Sealed for CalendarDatePicker {}
4662 impl sealed::NativeControl for CalendarDatePicker {
4663 fn into_element(self) -> Element {
4664 self.into()
4665 }
4666 }
4667 impl sealed::LayoutControl for CalendarDatePicker {
4668 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4669 &mut self.element_state
4670 }
4671 }
4672 impl LayoutControl for CalendarDatePicker {}
4673 #[non_exhaustive]
4674 #[repr(u8)]
4675 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
4676 pub enum CalendarDatePickerSlot {
4677 Header,
4678 }
4679 impl sealed::SlotIndex<CalendarDatePickerSlot> for CalendarDatePicker {
4680 fn slot_index(slot: CalendarDatePickerSlot) -> u8 {
4681 slot as u8
4682 }
4683 }
4684 impl SlotsControl for CalendarDatePicker {
4685 type Slot = CalendarDatePickerSlot;
4686 }
4687 #[derive(Clone, Debug, Default, PartialEq)]
4688 pub(crate) struct ToolTip {
4689 content: Option<Box<Element>>,
4690 }
4691 impl ToolTip {
4692 pub(crate) fn new() -> Self {
4693 Self::default()
4694 }
4695 }
4696 impl sealed::Sealed for ToolTip {}
4697 impl sealed::NativeControl for ToolTip {
4698 fn into_element(self) -> Element {
4699 self.into()
4700 }
4701 }
4702 impl sealed::ContentControl for ToolTip {}
4703 impl ContentControl for ToolTip {}
4704 #[cfg(test)]
4705 impl NativeContentTestExt for ToolTip {
4706 fn native_content(mut self, content: impl Into<Element>) -> Self {
4707 self.content = Some(Box::new(content.into()));
4708 self
4709 }
4710 }
4711 #[derive(Clone, Debug, Default, PartialEq)]
4712 pub struct ContentDialog {
4713 title: Property<String>,
4714 primary_button_text: Property<String>,
4715 secondary_button_text: Property<String>,
4716 close_button_text: Property<String>,
4717 is_primary_button_enabled: Property<bool>,
4718 is_secondary_button_enabled: Property<bool>,
4719 on_closed: Option<Callback<ContentDialogResult>>,
4720 content: Option<Box<Element>>,
4721 is_open: bool,
4722 }
4723 impl ContentDialog {
4724 pub fn new() -> Self {
4725 Self::default()
4726 }
4727 pub fn is_open(mut self, value: bool) -> Self {
4728 self.is_open = value;
4729 self
4730 }
4731 pub fn title(mut self, value: impl Into<String>) -> Self {
4732 self.title = Property::Set(value.into());
4733 self
4734 }
4735 pub fn title_optional<T>(mut self, value: Option<T>) -> Self
4736 where
4737 T: Into<String>,
4738 {
4739 self.title = Property::from(value.map(Into::into));
4740 self
4741 }
4742 pub fn primary_button_text(mut self, value: impl Into<String>) -> Self {
4743 self.primary_button_text = Property::Set(value.into());
4744 self
4745 }
4746 pub fn primary_button_text_optional<T>(mut self, value: Option<T>) -> Self
4747 where
4748 T: Into<String>,
4749 {
4750 self.primary_button_text = Property::from(value.map(Into::into));
4751 self
4752 }
4753 pub fn secondary_button_text(mut self, value: impl Into<String>) -> Self {
4754 self.secondary_button_text = Property::Set(value.into());
4755 self
4756 }
4757 pub fn secondary_button_text_optional<T>(mut self, value: Option<T>) -> Self
4758 where
4759 T: Into<String>,
4760 {
4761 self.secondary_button_text = Property::from(value.map(Into::into));
4762 self
4763 }
4764 pub fn close_button_text(mut self, value: impl Into<String>) -> Self {
4765 self.close_button_text = Property::Set(value.into());
4766 self
4767 }
4768 pub fn close_button_text_optional<T>(mut self, value: Option<T>) -> Self
4769 where
4770 T: Into<String>,
4771 {
4772 self.close_button_text = Property::from(value.map(Into::into));
4773 self
4774 }
4775 pub fn is_primary_button_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4776 let value = value.into();
4777 self.is_primary_button_enabled = Property::from(value);
4778 self
4779 }
4780 pub fn is_secondary_button_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4781 let value = value.into();
4782 self.is_secondary_button_enabled = Property::from(value);
4783 self
4784 }
4785 pub fn on_closed(
4786 mut self,
4787 callback: impl IntoPayloadCallback<ContentDialogResult>,
4788 ) -> Self {
4789 self.on_closed = Some(callback.into_payload_callback());
4790 self
4791 }
4792 }
4793 impl sealed::Sealed for ContentDialog {}
4794 impl sealed::NativeControl for ContentDialog {
4795 fn into_element(self) -> Element {
4796 self.into()
4797 }
4798 }
4799 impl sealed::ContentControl for ContentDialog {
4800 fn into_content_view(self, content: View) -> View {
4801 let open = self.is_open;
4802 View::content_dialog(self.into(), Some(content), open)
4803 }
4804 }
4805 impl ContentControl for ContentDialog {}
4806 #[cfg(test)]
4807 impl NativeContentTestExt for ContentDialog {
4808 fn native_content(mut self, content: impl Into<Element>) -> Self {
4809 self.content = Some(Box::new(content.into()));
4810 self
4811 }
4812 }
4813 #[derive(Clone, Debug, Default, PartialEq)]
4814 pub struct CalendarView {
4815 is_today_highlighted: Property<bool>,
4816 is_group_label_visible: Property<bool>,
4817 is_enabled: Property<bool>,
4818 on_selected_dates_changed: Option<Callback<()>>,
4819 element_state: Option<std::rc::Rc<ElementState>>,
4820 }
4821 impl CalendarView {
4822 pub fn new() -> Self {
4823 Self::default()
4824 }
4825 pub fn is_today_highlighted(mut self, value: impl Into<Option<bool>>) -> Self {
4826 let value = value.into();
4827 self.is_today_highlighted = Property::from(value);
4828 self
4829 }
4830 pub fn is_group_label_visible(mut self, value: impl Into<Option<bool>>) -> Self {
4831 let value = value.into();
4832 self.is_group_label_visible = Property::from(value);
4833 self
4834 }
4835 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
4836 let value = value.into();
4837 self.is_enabled = Property::from(value);
4838 self
4839 }
4840 pub fn on_selected_dates_changed(mut self, callback: impl IntoUnitCallback) -> Self {
4841 self.on_selected_dates_changed = Some(callback.into_unit_callback());
4842 self
4843 }
4844 }
4845 impl sealed::Sealed for CalendarView {}
4846 impl sealed::NativeControl for CalendarView {
4847 fn into_element(self) -> Element {
4848 self.into()
4849 }
4850 }
4851 impl sealed::LayoutControl for CalendarView {
4852 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4853 &mut self.element_state
4854 }
4855 }
4856 impl LayoutControl for CalendarView {}
4857 #[derive(Clone, Debug, Default, PartialEq)]
4858 pub struct ListView {
4859 selected_index: Property<Option<usize>>,
4860 selection_mode: Property<ListViewSelectionMode>,
4861 can_drag_items: Property<bool>,
4862 can_reorder_items: Property<bool>,
4863 allow_drop: Property<bool>,
4864 events: Option<std::rc::Rc<ListViewEvents>>,
4865 element_state: Option<std::rc::Rc<ElementState>>,
4866 }
4867 impl ListView {
4868 pub fn new() -> Self {
4869 Self::default()
4870 }
4871 pub fn selected_index(mut self, value: impl Into<Option<usize>>) -> Self {
4872 let value = value.into();
4873 self.selected_index = Property::Set(value);
4874 self
4875 }
4876 pub fn selection_mode(mut self, value: impl Into<Option<ListViewSelectionMode>>) -> Self {
4877 let value = value.into();
4878 self.selection_mode = Property::from(value);
4879 self
4880 }
4881 pub fn can_drag_items(mut self, value: impl Into<Option<bool>>) -> Self {
4882 let value = value.into();
4883 self.can_drag_items = Property::from(value);
4884 self
4885 }
4886 pub fn can_reorder_items(mut self, value: impl Into<Option<bool>>) -> Self {
4887 let value = value.into();
4888 self.can_reorder_items = Property::from(value);
4889 self
4890 }
4891 pub fn allow_drop(mut self, value: impl Into<Option<bool>>) -> Self {
4892 let value = value.into();
4893 self.allow_drop = Property::from(value);
4894 self
4895 }
4896 pub fn on_selection_changed(
4897 mut self,
4898 callback: impl IntoPayloadCallback<Option<usize>>,
4899 ) -> Self {
4900 std::rc::Rc::make_mut(
4901 self.events
4902 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
4903 )
4904 .on_selection_changed = Some(callback.into_payload_callback());
4905 self
4906 }
4907 pub fn on_reordered(mut self, callback: impl IntoPayloadCallback<Vec<String>>) -> Self {
4908 std::rc::Rc::make_mut(
4909 self.events
4910 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
4911 )
4912 .on_reordered = Some(callback.into_payload_callback());
4913 self
4914 }
4915 }
4916 impl sealed::Sealed for ListView {}
4917 impl sealed::NativeControl for ListView {
4918 fn into_element(self) -> Element {
4919 self.into()
4920 }
4921 }
4922 impl sealed::LayoutControl for ListView {
4923 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4924 &mut self.element_state
4925 }
4926 }
4927 impl LayoutControl for ListView {}
4928 #[non_exhaustive]
4929 #[repr(u8)]
4930 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
4931 pub enum ListViewSlot {
4932 Items,
4933 }
4934 impl sealed::SlotIndex<ListViewSlot> for ListView {
4935 fn slot_index(slot: ListViewSlot) -> u8 {
4936 slot as u8
4937 }
4938 }
4939 impl SlotsControl for ListView {
4940 type Slot = ListViewSlot;
4941 }
4942 #[derive(Clone, Debug, Default, PartialEq)]
4943 pub struct ListViewItem {
4944 tag: Property<String>,
4945 element_state: Option<std::rc::Rc<ElementState>>,
4946 content: Option<Box<Element>>,
4947 }
4948 impl ListViewItem {
4949 pub fn new() -> Self {
4950 Self::default()
4951 }
4952 pub fn tag(mut self, value: impl Into<String>) -> Self {
4953 self.tag = Property::Set(value.into());
4954 self
4955 }
4956 pub fn tag_optional<T>(mut self, value: Option<T>) -> Self
4957 where
4958 T: Into<String>,
4959 {
4960 self.tag = Property::from(value.map(Into::into));
4961 self
4962 }
4963 }
4964 impl sealed::Sealed for ListViewItem {}
4965 impl sealed::NativeControl for ListViewItem {
4966 fn into_element(self) -> Element {
4967 self.into()
4968 }
4969 }
4970 impl sealed::LayoutControl for ListViewItem {
4971 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
4972 &mut self.element_state
4973 }
4974 }
4975 impl LayoutControl for ListViewItem {}
4976 impl sealed::ContentControl for ListViewItem {}
4977 impl ContentControl for ListViewItem {}
4978 #[cfg(test)]
4979 impl NativeContentTestExt for ListViewItem {
4980 fn native_content(mut self, content: impl Into<Element>) -> Self {
4981 self.content = Some(Box::new(content.into()));
4982 self
4983 }
4984 }
4985 #[derive(Clone, Debug, Default, PartialEq)]
4986 pub struct TreeView {
4987 selection_mode: Property<TreeViewSelectionMode>,
4988 on_item_invoked: Option<Callback<String>>,
4989 element_state: Option<std::rc::Rc<ElementState>>,
4990 }
4991 impl TreeView {
4992 pub fn new() -> Self {
4993 Self::default()
4994 }
4995 pub fn selection_mode(mut self, value: impl Into<Option<TreeViewSelectionMode>>) -> Self {
4996 let value = value.into();
4997 self.selection_mode = Property::from(value);
4998 self
4999 }
5000 pub fn on_item_invoked(mut self, callback: impl IntoPayloadCallback<String>) -> Self {
5001 self.on_item_invoked = Some(callback.into_payload_callback());
5002 self
5003 }
5004 }
5005 impl sealed::Sealed for TreeView {}
5006 impl sealed::NativeControl for TreeView {
5007 fn into_element(self) -> Element {
5008 self.into()
5009 }
5010 }
5011 impl sealed::LayoutControl for TreeView {
5012 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
5013 &mut self.element_state
5014 }
5015 }
5016 impl LayoutControl for TreeView {}
5017 #[derive(Clone, Debug, Default, PartialEq)]
5018 pub struct GridView {
5019 selected_index: Property<Option<usize>>,
5020 can_drag_items: Property<bool>,
5021 can_reorder_items: Property<bool>,
5022 allow_drop: Property<bool>,
5023 events: Option<std::rc::Rc<GridViewEvents>>,
5024 element_state: Option<std::rc::Rc<ElementState>>,
5025 }
5026 impl GridView {
5027 pub fn new() -> Self {
5028 Self::default()
5029 }
5030 pub fn selected_index(mut self, value: impl Into<Option<usize>>) -> Self {
5031 let value = value.into();
5032 self.selected_index = Property::Set(value);
5033 self
5034 }
5035 pub fn can_drag_items(mut self, value: impl Into<Option<bool>>) -> Self {
5036 let value = value.into();
5037 self.can_drag_items = Property::from(value);
5038 self
5039 }
5040 pub fn can_reorder_items(mut self, value: impl Into<Option<bool>>) -> Self {
5041 let value = value.into();
5042 self.can_reorder_items = Property::from(value);
5043 self
5044 }
5045 pub fn allow_drop(mut self, value: impl Into<Option<bool>>) -> Self {
5046 let value = value.into();
5047 self.allow_drop = Property::from(value);
5048 self
5049 }
5050 pub fn on_reordered(mut self, callback: impl IntoPayloadCallback<Vec<String>>) -> Self {
5051 std::rc::Rc::make_mut(
5052 self.events
5053 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
5054 )
5055 .on_reordered = Some(callback.into_payload_callback());
5056 self
5057 }
5058 pub fn on_selection_changed(
5059 mut self,
5060 callback: impl IntoPayloadCallback<Option<usize>>,
5061 ) -> Self {
5062 std::rc::Rc::make_mut(
5063 self.events
5064 .get_or_insert_with(|| std::rc::Rc::new(Default::default())),
5065 )
5066 .on_selection_changed = Some(callback.into_payload_callback());
5067 self
5068 }
5069 }
5070 impl sealed::Sealed for GridView {}
5071 impl sealed::NativeControl for GridView {
5072 fn into_element(self) -> Element {
5073 self.into()
5074 }
5075 }
5076 impl sealed::LayoutControl for GridView {
5077 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
5078 &mut self.element_state
5079 }
5080 }
5081 impl LayoutControl for GridView {}
5082 #[non_exhaustive]
5083 #[repr(u8)]
5084 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
5085 pub enum GridViewSlot {
5086 Items,
5087 }
5088 impl sealed::SlotIndex<GridViewSlot> for GridView {
5089 fn slot_index(slot: GridViewSlot) -> u8 {
5090 slot as u8
5091 }
5092 }
5093 impl SlotsControl for GridView {
5094 type Slot = GridViewSlot;
5095 }
5096 #[derive(Clone, Debug, Default, PartialEq)]
5097 pub struct GridViewItem {
5098 tag: Property<String>,
5099 element_state: Option<std::rc::Rc<ElementState>>,
5100 content: Option<Box<Element>>,
5101 }
5102 impl GridViewItem {
5103 pub fn new() -> Self {
5104 Self::default()
5105 }
5106 pub fn tag(mut self, value: impl Into<String>) -> Self {
5107 self.tag = Property::Set(value.into());
5108 self
5109 }
5110 pub fn tag_optional<T>(mut self, value: Option<T>) -> Self
5111 where
5112 T: Into<String>,
5113 {
5114 self.tag = Property::from(value.map(Into::into));
5115 self
5116 }
5117 }
5118 impl sealed::Sealed for GridViewItem {}
5119 impl sealed::NativeControl for GridViewItem {
5120 fn into_element(self) -> Element {
5121 self.into()
5122 }
5123 }
5124 impl sealed::LayoutControl for GridViewItem {
5125 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
5126 &mut self.element_state
5127 }
5128 }
5129 impl LayoutControl for GridViewItem {}
5130 impl sealed::ContentControl for GridViewItem {}
5131 impl ContentControl for GridViewItem {}
5132 #[cfg(test)]
5133 impl NativeContentTestExt for GridViewItem {
5134 fn native_content(mut self, content: impl Into<Element>) -> Self {
5135 self.content = Some(Box::new(content.into()));
5136 self
5137 }
5138 }
5139 #[derive(Clone, Debug, Default, PartialEq)]
5140 pub struct RelativePanel {
5141 element_state: Option<std::rc::Rc<ElementState>>,
5142 children: std::rc::Rc<Vec<KeyedElement>>,
5143 }
5144 impl RelativePanel {
5145 pub fn new() -> Self {
5146 Self::default()
5147 }
5148 }
5149 impl sealed::Sealed for RelativePanel {}
5150 impl sealed::NativeControl for RelativePanel {
5151 fn into_element(self) -> Element {
5152 self.into()
5153 }
5154 }
5155 impl sealed::LayoutControl for RelativePanel {
5156 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
5157 &mut self.element_state
5158 }
5159 }
5160 impl LayoutControl for RelativePanel {}
5161 impl ChildrenControl for RelativePanel {}
5162 #[cfg(test)]
5163 impl NativeChildrenTestExt for RelativePanel {
5164 fn native_child(mut self, key: impl Into<Key>, child: impl Into<Element>) -> Self {
5165 std::rc::Rc::make_mut(&mut self.children).push(KeyedElement::new(key, child));
5166 self
5167 }
5168 fn native_children(mut self, children: impl IntoIterator<Item = KeyedElement>) -> Self {
5169 self.children = std::rc::Rc::new(children.into_iter().collect());
5170 self
5171 }
5172 }
5173 #[derive(Clone, Debug, Default, PartialEq)]
5174 pub struct Canvas {
5175 element_state: Option<std::rc::Rc<ElementState>>,
5176 children: std::rc::Rc<Vec<KeyedElement>>,
5177 }
5178 impl Canvas {
5179 pub fn new() -> Self {
5180 Self::default()
5181 }
5182 }
5183 impl sealed::Sealed for Canvas {}
5184 impl sealed::NativeControl for Canvas {
5185 fn into_element(self) -> Element {
5186 self.into()
5187 }
5188 }
5189 impl sealed::LayoutControl for Canvas {
5190 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
5191 &mut self.element_state
5192 }
5193 }
5194 impl LayoutControl for Canvas {}
5195 impl ChildrenControl for Canvas {}
5196 #[cfg(test)]
5197 impl NativeChildrenTestExt for Canvas {
5198 fn native_child(mut self, key: impl Into<Key>, child: impl Into<Element>) -> Self {
5199 std::rc::Rc::make_mut(&mut self.children).push(KeyedElement::new(key, child));
5200 self
5201 }
5202 fn native_children(mut self, children: impl IntoIterator<Item = KeyedElement>) -> Self {
5203 self.children = std::rc::Rc::new(children.into_iter().collect());
5204 self
5205 }
5206 }
5207 #[derive(Clone, Debug, Default, PartialEq)]
5208 pub struct RichEditBox {
5209 text: Property<String>,
5210 placeholder_text: Property<String>,
5211 is_read_only: Property<bool>,
5212 is_enabled: Property<bool>,
5213 on_text_changed: Option<Callback<String>>,
5214 reference: Option<NativeElementRef>,
5215 element_state: Option<std::rc::Rc<ElementState>>,
5216 }
5217 impl RichEditBox {
5218 pub fn new() -> Self {
5219 Self::default()
5220 }
5221 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
5222 self.reference = Some(reference.binding());
5223 self
5224 }
5225 pub fn text(mut self, value: impl Into<String>) -> Self {
5226 self.text = Property::Set(value.into());
5227 self
5228 }
5229 pub fn text_optional<T>(mut self, value: Option<T>) -> Self
5230 where
5231 T: Into<String>,
5232 {
5233 self.text = Property::from(value.map(Into::into));
5234 self
5235 }
5236 pub fn placeholder_text(mut self, value: impl Into<String>) -> Self {
5237 self.placeholder_text = Property::Set(value.into());
5238 self
5239 }
5240 pub fn placeholder_text_optional<T>(mut self, value: Option<T>) -> Self
5241 where
5242 T: Into<String>,
5243 {
5244 self.placeholder_text = Property::from(value.map(Into::into));
5245 self
5246 }
5247 pub fn is_read_only(mut self, value: impl Into<Option<bool>>) -> Self {
5248 let value = value.into();
5249 self.is_read_only = Property::from(value);
5250 self
5251 }
5252 pub fn is_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
5253 let value = value.into();
5254 self.is_enabled = Property::from(value);
5255 self
5256 }
5257 pub fn on_text_changed(mut self, callback: impl IntoPayloadCallback<String>) -> Self {
5258 self.on_text_changed = Some(callback.into_payload_callback());
5259 self
5260 }
5261 }
5262 impl sealed::Sealed for RichEditBox {}
5263 impl sealed::NativeControl for RichEditBox {
5264 fn into_element(self) -> Element {
5265 self.into()
5266 }
5267 }
5268 impl crate::reference::sealed::Sealed for RichEditBox {}
5269 impl crate::reference::ReferenceControl for RichEditBox {}
5270 impl sealed::LayoutControl for RichEditBox {
5271 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
5272 &mut self.element_state
5273 }
5274 }
5275 impl LayoutControl for RichEditBox {}
5276 impl FocusControl for RichEditBox {}
5277 #[non_exhaustive]
5278 #[repr(u8)]
5279 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
5280 pub enum RichEditBoxSlot {
5281 Header,
5282 }
5283 impl sealed::SlotIndex<RichEditBoxSlot> for RichEditBox {
5284 fn slot_index(slot: RichEditBoxSlot) -> u8 {
5285 slot as u8
5286 }
5287 }
5288 impl SlotsControl for RichEditBox {
5289 type Slot = RichEditBoxSlot;
5290 }
5291 #[derive(Clone, Debug, Default, PartialEq)]
5292 pub struct RichTextBlock {
5293 paragraphs: Property<RichText>,
5294 font_size: Property<f64>,
5295 is_text_selection_enabled: Property<bool>,
5296 text_wrapping: Property<TextWrapping>,
5297 element_state: Option<std::rc::Rc<ElementState>>,
5298 }
5299 impl RichTextBlock {
5300 pub fn new() -> Self {
5301 Self::default()
5302 }
5303 pub fn paragraphs(mut self, value: impl Into<Option<RichText>>) -> Self {
5304 let value = value.into();
5305 self.paragraphs = Property::from(value);
5306 self
5307 }
5308 pub fn font_size(mut self, value: impl Into<Option<f64>>) -> Self {
5309 let value = value.into();
5310 assert!(
5311 value
5312 .as_ref()
5313 .is_none_or(|value| value.is_finite() && *value > 0.0),
5314 "RichTextBlock FontSize must be finite and positive",
5315 );
5316 self.font_size = Property::from(value);
5317 self
5318 }
5319 pub fn is_text_selection_enabled(mut self, value: impl Into<Option<bool>>) -> Self {
5320 let value = value.into();
5321 self.is_text_selection_enabled = Property::from(value);
5322 self
5323 }
5324 pub fn text_wrapping(mut self, value: impl Into<Option<TextWrapping>>) -> Self {
5325 let value = value.into();
5326 self.text_wrapping = Property::from(value);
5327 self
5328 }
5329 }
5330 impl sealed::Sealed for RichTextBlock {}
5331 impl sealed::NativeControl for RichTextBlock {
5332 fn into_element(self) -> Element {
5333 self.into()
5334 }
5335 }
5336 impl sealed::LayoutControl for RichTextBlock {
5337 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
5338 &mut self.element_state
5339 }
5340 }
5341 impl LayoutControl for RichTextBlock {}
5342 #[derive(Clone, Debug, Default, PartialEq)]
5343 pub struct Viewbox {
5344 stretch: Property<Stretch>,
5345 element_state: Option<std::rc::Rc<ElementState>>,
5346 }
5347 impl Viewbox {
5348 pub fn new() -> Self {
5349 Self::default()
5350 }
5351 pub fn stretch(mut self, value: impl Into<Option<Stretch>>) -> Self {
5352 let value = value.into();
5353 self.stretch = Property::from(value);
5354 self
5355 }
5356 }
5357 impl sealed::Sealed for Viewbox {}
5358 impl sealed::NativeControl for Viewbox {
5359 fn into_element(self) -> Element {
5360 self.into()
5361 }
5362 }
5363 impl sealed::LayoutControl for Viewbox {
5364 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
5365 &mut self.element_state
5366 }
5367 }
5368 impl LayoutControl for Viewbox {}
5369 #[non_exhaustive]
5370 #[repr(u8)]
5371 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
5372 pub enum ViewboxSlot {
5373 Child,
5374 }
5375 impl sealed::SlotIndex<ViewboxSlot> for Viewbox {
5376 fn slot_index(slot: ViewboxSlot) -> u8 {
5377 slot as u8
5378 }
5379 }
5380 impl SlotsControl for Viewbox {
5381 type Slot = ViewboxSlot;
5382 }
5383 #[derive(Clone, Debug, Default, PartialEq)]
5384 pub struct WebView2 {
5385 reference: Option<NativeElementRef>,
5386 element_state: Option<std::rc::Rc<ElementState>>,
5387 }
5388 impl WebView2 {
5389 pub fn new() -> Self {
5390 Self::default()
5391 }
5392 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
5393 self.reference = Some(reference.binding());
5394 self
5395 }
5396 }
5397 impl sealed::Sealed for WebView2 {}
5398 impl sealed::NativeControl for WebView2 {
5399 fn into_element(self) -> Element {
5400 self.into()
5401 }
5402 }
5403 impl crate::reference::sealed::Sealed for WebView2 {}
5404 impl crate::reference::ReferenceControl for WebView2 {}
5405 impl sealed::LayoutControl for WebView2 {
5406 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
5407 &mut self.element_state
5408 }
5409 }
5410 impl LayoutControl for WebView2 {}
5411 #[derive(Clone, Debug, Default, PartialEq)]
5412 pub struct SwapChainPanel {
5413 reference: Option<NativeElementRef>,
5414 element_state: Option<std::rc::Rc<ElementState>>,
5415 }
5416 impl SwapChainPanel {
5417 pub fn new() -> Self {
5418 Self::default()
5419 }
5420 pub fn element_ref(mut self, reference: &ElementRef<Self>) -> Self {
5421 self.reference = Some(reference.binding());
5422 self
5423 }
5424 }
5425 impl sealed::Sealed for SwapChainPanel {}
5426 impl sealed::NativeControl for SwapChainPanel {
5427 fn into_element(self) -> Element {
5428 self.into()
5429 }
5430 }
5431 impl crate::reference::sealed::Sealed for SwapChainPanel {}
5432 impl crate::reference::ReferenceControl for SwapChainPanel {}
5433 impl sealed::LayoutControl for SwapChainPanel {
5434 fn element_state_mut(&mut self) -> &mut Option<std::rc::Rc<ElementState>> {
5435 &mut self.element_state
5436 }
5437 }
5438 impl LayoutControl for SwapChainPanel {}
5439 #[derive(Clone, Debug, PartialEq)]
5440 pub(crate) enum Element {
5441 TextBlock(std::rc::Rc<TextBlock>),
5442 Button(std::rc::Rc<Button>),
5443 HyperlinkButton(std::rc::Rc<HyperlinkButton>),
5444 RepeatButton(std::rc::Rc<RepeatButton>),
5445 Border(std::rc::Rc<Border>),
5446 BreadcrumbBar(std::rc::Rc<BreadcrumbBar>),
5447 StackPanel(std::rc::Rc<StackPanel>),
5448 VariableSizedWrapGrid(std::rc::Rc<VariableSizedWrapGrid>),
5449 Grid(std::rc::Rc<Grid>),
5450 TextBox(std::rc::Rc<TextBox>),
5451 AutoSuggestBox(std::rc::Rc<AutoSuggestBox>),
5452 PasswordBox(std::rc::Rc<PasswordBox>),
5453 NumberBox(std::rc::Rc<NumberBox>),
5454 Slider(std::rc::Rc<Slider>),
5455 TitleBar(std::rc::Rc<TitleBar>),
5456 NavigationView(std::rc::Rc<NavigationView>),
5457 NavigationViewItem(std::rc::Rc<NavigationViewItem>),
5458 SplitView(std::rc::Rc<SplitView>),
5459 ProgressBar(std::rc::Rc<ProgressBar>),
5460 ToggleSwitch(std::rc::Rc<ToggleSwitch>),
5461 CheckBox(std::rc::Rc<CheckBox>),
5462 ToggleButton(std::rc::Rc<ToggleButton>),
5463 RadioButton(std::rc::Rc<RadioButton>),
5464 RadioButtons(std::rc::Rc<RadioButtons>),
5465 ItemsRepeater(std::rc::Rc<ItemsRepeater>),
5466 InfoBadge(std::rc::Rc<InfoBadge>),
5467 InfoBar(std::rc::Rc<InfoBar>),
5468 PersonPicture(std::rc::Rc<PersonPicture>),
5469 ScrollViewer(std::rc::Rc<ScrollViewer>),
5470 ScrollView(std::rc::Rc<ScrollView>),
5471 Image(std::rc::Rc<Image>),
5472 ProgressRing(std::rc::Rc<ProgressRing>),
5473 ListBox(std::rc::Rc<ListBox>),
5474 Rectangle(std::rc::Rc<Rectangle>),
5475 Ellipse(std::rc::Rc<Ellipse>),
5476 Line(std::rc::Rc<Line>),
5477 SymbolIcon(std::rc::Rc<SymbolIcon>),
5478 ImageIcon(std::rc::Rc<ImageIcon>),
5479 FontIcon(std::rc::Rc<FontIcon>),
5480 BitmapIcon(std::rc::Rc<BitmapIcon>),
5481 PathIcon(std::rc::Rc<PathIcon>),
5482 ListBoxItem(std::rc::Rc<ListBoxItem>),
5483 RatingControl(std::rc::Rc<RatingControl>),
5484 Expander(std::rc::Rc<Expander>),
5485 ComboBox(std::rc::Rc<ComboBox>),
5486 Pivot(std::rc::Rc<Pivot>),
5487 PivotItem(std::rc::Rc<PivotItem>),
5488 FlipView(std::rc::Rc<FlipView>),
5489 SelectorBar(std::rc::Rc<SelectorBar>),
5490 SelectorBarItem(std::rc::Rc<SelectorBarItem>),
5491 TabView(std::rc::Rc<TabView>),
5492 TabViewItem(std::rc::Rc<TabViewItem>),
5493 TeachingTip(std::rc::Rc<TeachingTip>),
5494 DropDownButton(std::rc::Rc<DropDownButton>),
5495 CommandBar(std::rc::Rc<CommandBar>),
5496 AppBarButton(std::rc::Rc<AppBarButton>),
5497 AppBarSeparator(std::rc::Rc<AppBarSeparator>),
5498 MenuBar(std::rc::Rc<MenuBar>),
5499 MenuBarItem(std::rc::Rc<MenuBarItem>),
5500 SplitButton(std::rc::Rc<SplitButton>),
5501 ColorPicker(std::rc::Rc<ColorPicker>),
5502 DatePicker(std::rc::Rc<DatePicker>),
5503 TimePicker(std::rc::Rc<TimePicker>),
5504 CalendarDatePicker(std::rc::Rc<CalendarDatePicker>),
5505 ToolTip(std::rc::Rc<ToolTip>),
5506 ContentDialog(std::rc::Rc<ContentDialog>),
5507 CalendarView(std::rc::Rc<CalendarView>),
5508 ListView(std::rc::Rc<ListView>),
5509 ListViewItem(std::rc::Rc<ListViewItem>),
5510 TreeView(std::rc::Rc<TreeView>),
5511 GridView(std::rc::Rc<GridView>),
5512 GridViewItem(std::rc::Rc<GridViewItem>),
5513 RelativePanel(std::rc::Rc<RelativePanel>),
5514 Canvas(std::rc::Rc<Canvas>),
5515 RichEditBox(std::rc::Rc<RichEditBox>),
5516 RichTextBlock(std::rc::Rc<RichTextBlock>),
5517 Viewbox(std::rc::Rc<Viewbox>),
5518 WebView2(std::rc::Rc<WebView2>),
5519 SwapChainPanel(std::rc::Rc<SwapChainPanel>),
5520 }
5521 impl From<TextBlock> for Element {
5522 fn from(value: TextBlock) -> Self {
5523 Self::TextBlock(std::rc::Rc::new(value))
5524 }
5525 }
5526 impl From<TextBlock> for View {
5527 fn from(value: TextBlock) -> Self {
5528 Self::native(value)
5529 }
5530 }
5531 impl From<Button> for Element {
5532 fn from(value: Button) -> Self {
5533 Self::Button(std::rc::Rc::new(value))
5534 }
5535 }
5536 impl From<Button> for View {
5537 fn from(value: Button) -> Self {
5538 Self::native(value)
5539 }
5540 }
5541 impl From<HyperlinkButton> for Element {
5542 fn from(value: HyperlinkButton) -> Self {
5543 Self::HyperlinkButton(std::rc::Rc::new(value))
5544 }
5545 }
5546 impl From<HyperlinkButton> for View {
5547 fn from(value: HyperlinkButton) -> Self {
5548 Self::native(value)
5549 }
5550 }
5551 impl From<RepeatButton> for Element {
5552 fn from(value: RepeatButton) -> Self {
5553 Self::RepeatButton(std::rc::Rc::new(value))
5554 }
5555 }
5556 impl From<RepeatButton> for View {
5557 fn from(value: RepeatButton) -> Self {
5558 Self::native(value)
5559 }
5560 }
5561 impl From<Border> for Element {
5562 fn from(value: Border) -> Self {
5563 Self::Border(std::rc::Rc::new(value))
5564 }
5565 }
5566 impl From<Border> for View {
5567 fn from(value: Border) -> Self {
5568 Self::native(value)
5569 }
5570 }
5571 impl From<BreadcrumbBar> for Element {
5572 fn from(value: BreadcrumbBar) -> Self {
5573 Self::BreadcrumbBar(std::rc::Rc::new(value))
5574 }
5575 }
5576 impl From<BreadcrumbBar> for View {
5577 fn from(value: BreadcrumbBar) -> Self {
5578 Self::native(value)
5579 }
5580 }
5581 impl From<StackPanel> for Element {
5582 fn from(value: StackPanel) -> Self {
5583 Self::StackPanel(std::rc::Rc::new(value))
5584 }
5585 }
5586 impl From<StackPanel> for View {
5587 fn from(value: StackPanel) -> Self {
5588 Self::native(value)
5589 }
5590 }
5591 impl From<VariableSizedWrapGrid> for Element {
5592 fn from(value: VariableSizedWrapGrid) -> Self {
5593 Self::VariableSizedWrapGrid(std::rc::Rc::new(value))
5594 }
5595 }
5596 impl From<VariableSizedWrapGrid> for View {
5597 fn from(value: VariableSizedWrapGrid) -> Self {
5598 Self::native(value)
5599 }
5600 }
5601 impl From<Grid> for Element {
5602 fn from(value: Grid) -> Self {
5603 Self::Grid(std::rc::Rc::new(value))
5604 }
5605 }
5606 impl From<Grid> for View {
5607 fn from(value: Grid) -> Self {
5608 Self::native(value)
5609 }
5610 }
5611 impl From<TextBox> for Element {
5612 fn from(value: TextBox) -> Self {
5613 Self::TextBox(std::rc::Rc::new(value))
5614 }
5615 }
5616 impl From<TextBox> for View {
5617 fn from(value: TextBox) -> Self {
5618 Self::native(value)
5619 }
5620 }
5621 impl From<AutoSuggestBox> for Element {
5622 fn from(value: AutoSuggestBox) -> Self {
5623 Self::AutoSuggestBox(std::rc::Rc::new(value))
5624 }
5625 }
5626 impl From<AutoSuggestBox> for View {
5627 fn from(value: AutoSuggestBox) -> Self {
5628 Self::native(value)
5629 }
5630 }
5631 impl From<PasswordBox> for Element {
5632 fn from(value: PasswordBox) -> Self {
5633 Self::PasswordBox(std::rc::Rc::new(value))
5634 }
5635 }
5636 impl From<PasswordBox> for View {
5637 fn from(value: PasswordBox) -> Self {
5638 Self::native(value)
5639 }
5640 }
5641 impl From<NumberBox> for Element {
5642 fn from(value: NumberBox) -> Self {
5643 Self::NumberBox(std::rc::Rc::new(value))
5644 }
5645 }
5646 impl From<NumberBox> for View {
5647 fn from(value: NumberBox) -> Self {
5648 Self::native(value)
5649 }
5650 }
5651 impl From<Slider> for Element {
5652 fn from(value: Slider) -> Self {
5653 Self::Slider(std::rc::Rc::new(value))
5654 }
5655 }
5656 impl From<Slider> for View {
5657 fn from(value: Slider) -> Self {
5658 Self::native(value)
5659 }
5660 }
5661 impl From<TitleBar> for Element {
5662 fn from(value: TitleBar) -> Self {
5663 Self::TitleBar(std::rc::Rc::new(value))
5664 }
5665 }
5666 impl From<TitleBar> for View {
5667 fn from(value: TitleBar) -> Self {
5668 Self::native(value)
5669 }
5670 }
5671 impl From<NavigationView> for Element {
5672 fn from(value: NavigationView) -> Self {
5673 Self::NavigationView(std::rc::Rc::new(value))
5674 }
5675 }
5676 impl From<NavigationView> for View {
5677 fn from(value: NavigationView) -> Self {
5678 Self::native(value)
5679 }
5680 }
5681 impl From<NavigationViewItem> for Element {
5682 fn from(value: NavigationViewItem) -> Self {
5683 Self::NavigationViewItem(std::rc::Rc::new(value))
5684 }
5685 }
5686 impl From<NavigationViewItem> for View {
5687 fn from(value: NavigationViewItem) -> Self {
5688 Self::native(value)
5689 }
5690 }
5691 impl From<SplitView> for Element {
5692 fn from(value: SplitView) -> Self {
5693 Self::SplitView(std::rc::Rc::new(value))
5694 }
5695 }
5696 impl From<SplitView> for View {
5697 fn from(value: SplitView) -> Self {
5698 Self::native(value)
5699 }
5700 }
5701 impl From<ProgressBar> for Element {
5702 fn from(value: ProgressBar) -> Self {
5703 Self::ProgressBar(std::rc::Rc::new(value))
5704 }
5705 }
5706 impl From<ProgressBar> for View {
5707 fn from(value: ProgressBar) -> Self {
5708 Self::native(value)
5709 }
5710 }
5711 impl From<ToggleSwitch> for Element {
5712 fn from(value: ToggleSwitch) -> Self {
5713 Self::ToggleSwitch(std::rc::Rc::new(value))
5714 }
5715 }
5716 impl From<ToggleSwitch> for View {
5717 fn from(value: ToggleSwitch) -> Self {
5718 Self::native(value)
5719 }
5720 }
5721 impl From<CheckBox> for Element {
5722 fn from(value: CheckBox) -> Self {
5723 Self::CheckBox(std::rc::Rc::new(value))
5724 }
5725 }
5726 impl From<CheckBox> for View {
5727 fn from(value: CheckBox) -> Self {
5728 Self::native(value)
5729 }
5730 }
5731 impl From<ToggleButton> for Element {
5732 fn from(value: ToggleButton) -> Self {
5733 Self::ToggleButton(std::rc::Rc::new(value))
5734 }
5735 }
5736 impl From<ToggleButton> for View {
5737 fn from(value: ToggleButton) -> Self {
5738 Self::native(value)
5739 }
5740 }
5741 impl From<RadioButton> for Element {
5742 fn from(value: RadioButton) -> Self {
5743 Self::RadioButton(std::rc::Rc::new(value))
5744 }
5745 }
5746 impl From<RadioButton> for View {
5747 fn from(value: RadioButton) -> Self {
5748 Self::native(value)
5749 }
5750 }
5751 impl From<RadioButtons> for Element {
5752 fn from(value: RadioButtons) -> Self {
5753 Self::RadioButtons(std::rc::Rc::new(value))
5754 }
5755 }
5756 impl From<RadioButtons> for View {
5757 fn from(value: RadioButtons) -> Self {
5758 Self::native(value)
5759 }
5760 }
5761 impl From<ItemsRepeater> for Element {
5762 fn from(value: ItemsRepeater) -> Self {
5763 Self::ItemsRepeater(std::rc::Rc::new(value))
5764 }
5765 }
5766 impl From<ItemsRepeater> for View {
5767 fn from(value: ItemsRepeater) -> Self {
5768 Self::native(value)
5769 }
5770 }
5771 impl From<InfoBadge> for Element {
5772 fn from(value: InfoBadge) -> Self {
5773 Self::InfoBadge(std::rc::Rc::new(value))
5774 }
5775 }
5776 impl From<InfoBadge> for View {
5777 fn from(value: InfoBadge) -> Self {
5778 Self::native(value)
5779 }
5780 }
5781 impl From<InfoBar> for Element {
5782 fn from(value: InfoBar) -> Self {
5783 Self::InfoBar(std::rc::Rc::new(value))
5784 }
5785 }
5786 impl From<InfoBar> for View {
5787 fn from(value: InfoBar) -> Self {
5788 Self::native(value)
5789 }
5790 }
5791 impl From<PersonPicture> for Element {
5792 fn from(value: PersonPicture) -> Self {
5793 Self::PersonPicture(std::rc::Rc::new(value))
5794 }
5795 }
5796 impl From<PersonPicture> for View {
5797 fn from(value: PersonPicture) -> Self {
5798 Self::native(value)
5799 }
5800 }
5801 impl From<ScrollViewer> for Element {
5802 fn from(value: ScrollViewer) -> Self {
5803 Self::ScrollViewer(std::rc::Rc::new(value))
5804 }
5805 }
5806 impl From<ScrollViewer> for View {
5807 fn from(value: ScrollViewer) -> Self {
5808 Self::native(value)
5809 }
5810 }
5811 impl From<ScrollView> for Element {
5812 fn from(value: ScrollView) -> Self {
5813 Self::ScrollView(std::rc::Rc::new(value))
5814 }
5815 }
5816 impl From<ScrollView> for View {
5817 fn from(value: ScrollView) -> Self {
5818 Self::native(value)
5819 }
5820 }
5821 impl From<Image> for Element {
5822 fn from(value: Image) -> Self {
5823 Self::Image(std::rc::Rc::new(value))
5824 }
5825 }
5826 impl From<Image> for View {
5827 fn from(value: Image) -> Self {
5828 Self::native(value)
5829 }
5830 }
5831 impl From<ProgressRing> for Element {
5832 fn from(value: ProgressRing) -> Self {
5833 Self::ProgressRing(std::rc::Rc::new(value))
5834 }
5835 }
5836 impl From<ProgressRing> for View {
5837 fn from(value: ProgressRing) -> Self {
5838 Self::native(value)
5839 }
5840 }
5841 impl From<ListBox> for Element {
5842 fn from(value: ListBox) -> Self {
5843 Self::ListBox(std::rc::Rc::new(value))
5844 }
5845 }
5846 impl From<ListBox> for View {
5847 fn from(value: ListBox) -> Self {
5848 Self::native(value)
5849 }
5850 }
5851 impl From<Rectangle> for Element {
5852 fn from(value: Rectangle) -> Self {
5853 Self::Rectangle(std::rc::Rc::new(value))
5854 }
5855 }
5856 impl From<Rectangle> for View {
5857 fn from(value: Rectangle) -> Self {
5858 Self::native(value)
5859 }
5860 }
5861 impl From<Ellipse> for Element {
5862 fn from(value: Ellipse) -> Self {
5863 Self::Ellipse(std::rc::Rc::new(value))
5864 }
5865 }
5866 impl From<Ellipse> for View {
5867 fn from(value: Ellipse) -> Self {
5868 Self::native(value)
5869 }
5870 }
5871 impl From<Line> for Element {
5872 fn from(value: Line) -> Self {
5873 Self::Line(std::rc::Rc::new(value))
5874 }
5875 }
5876 impl From<Line> for View {
5877 fn from(value: Line) -> Self {
5878 Self::native(value)
5879 }
5880 }
5881 impl From<SymbolIcon> for Element {
5882 fn from(value: SymbolIcon) -> Self {
5883 Self::SymbolIcon(std::rc::Rc::new(value))
5884 }
5885 }
5886 impl From<SymbolIcon> for View {
5887 fn from(value: SymbolIcon) -> Self {
5888 Self::native(value)
5889 }
5890 }
5891 impl From<ImageIcon> for Element {
5892 fn from(value: ImageIcon) -> Self {
5893 Self::ImageIcon(std::rc::Rc::new(value))
5894 }
5895 }
5896 impl From<ImageIcon> for View {
5897 fn from(value: ImageIcon) -> Self {
5898 Self::native(value)
5899 }
5900 }
5901 impl From<FontIcon> for Element {
5902 fn from(value: FontIcon) -> Self {
5903 Self::FontIcon(std::rc::Rc::new(value))
5904 }
5905 }
5906 impl From<FontIcon> for View {
5907 fn from(value: FontIcon) -> Self {
5908 Self::native(value)
5909 }
5910 }
5911 impl From<BitmapIcon> for Element {
5912 fn from(value: BitmapIcon) -> Self {
5913 Self::BitmapIcon(std::rc::Rc::new(value))
5914 }
5915 }
5916 impl From<BitmapIcon> for View {
5917 fn from(value: BitmapIcon) -> Self {
5918 Self::native(value)
5919 }
5920 }
5921 impl From<PathIcon> for Element {
5922 fn from(value: PathIcon) -> Self {
5923 Self::PathIcon(std::rc::Rc::new(value))
5924 }
5925 }
5926 impl From<PathIcon> for View {
5927 fn from(value: PathIcon) -> Self {
5928 Self::native(value)
5929 }
5930 }
5931 impl From<ListBoxItem> for Element {
5932 fn from(value: ListBoxItem) -> Self {
5933 Self::ListBoxItem(std::rc::Rc::new(value))
5934 }
5935 }
5936 impl From<ListBoxItem> for View {
5937 fn from(value: ListBoxItem) -> Self {
5938 Self::native(value)
5939 }
5940 }
5941 impl From<RatingControl> for Element {
5942 fn from(value: RatingControl) -> Self {
5943 Self::RatingControl(std::rc::Rc::new(value))
5944 }
5945 }
5946 impl From<RatingControl> for View {
5947 fn from(value: RatingControl) -> Self {
5948 Self::native(value)
5949 }
5950 }
5951 impl From<Expander> for Element {
5952 fn from(value: Expander) -> Self {
5953 Self::Expander(std::rc::Rc::new(value))
5954 }
5955 }
5956 impl From<Expander> for View {
5957 fn from(value: Expander) -> Self {
5958 Self::native(value)
5959 }
5960 }
5961 impl From<ComboBox> for Element {
5962 fn from(value: ComboBox) -> Self {
5963 Self::ComboBox(std::rc::Rc::new(value))
5964 }
5965 }
5966 impl From<ComboBox> for View {
5967 fn from(value: ComboBox) -> Self {
5968 Self::native(value)
5969 }
5970 }
5971 impl From<Pivot> for Element {
5972 fn from(value: Pivot) -> Self {
5973 Self::Pivot(std::rc::Rc::new(value))
5974 }
5975 }
5976 impl From<Pivot> for View {
5977 fn from(value: Pivot) -> Self {
5978 Self::native(value)
5979 }
5980 }
5981 impl From<PivotItem> for Element {
5982 fn from(value: PivotItem) -> Self {
5983 Self::PivotItem(std::rc::Rc::new(value))
5984 }
5985 }
5986 impl From<PivotItem> for View {
5987 fn from(value: PivotItem) -> Self {
5988 Self::native(value)
5989 }
5990 }
5991 impl From<FlipView> for Element {
5992 fn from(value: FlipView) -> Self {
5993 Self::FlipView(std::rc::Rc::new(value))
5994 }
5995 }
5996 impl From<FlipView> for View {
5997 fn from(value: FlipView) -> Self {
5998 Self::native(value)
5999 }
6000 }
6001 impl From<SelectorBar> for Element {
6002 fn from(value: SelectorBar) -> Self {
6003 Self::SelectorBar(std::rc::Rc::new(value))
6004 }
6005 }
6006 impl From<SelectorBar> for View {
6007 fn from(value: SelectorBar) -> Self {
6008 Self::native(value)
6009 }
6010 }
6011 impl From<SelectorBarItem> for Element {
6012 fn from(value: SelectorBarItem) -> Self {
6013 Self::SelectorBarItem(std::rc::Rc::new(value))
6014 }
6015 }
6016 impl From<SelectorBarItem> for View {
6017 fn from(value: SelectorBarItem) -> Self {
6018 Self::native(value)
6019 }
6020 }
6021 impl From<TabView> for Element {
6022 fn from(value: TabView) -> Self {
6023 Self::TabView(std::rc::Rc::new(value))
6024 }
6025 }
6026 impl From<TabView> for View {
6027 fn from(value: TabView) -> Self {
6028 Self::native(value)
6029 }
6030 }
6031 impl From<TabViewItem> for Element {
6032 fn from(value: TabViewItem) -> Self {
6033 Self::TabViewItem(std::rc::Rc::new(value))
6034 }
6035 }
6036 impl From<TabViewItem> for View {
6037 fn from(value: TabViewItem) -> Self {
6038 Self::native(value)
6039 }
6040 }
6041 impl From<TeachingTip> for Element {
6042 fn from(value: TeachingTip) -> Self {
6043 Self::TeachingTip(std::rc::Rc::new(value))
6044 }
6045 }
6046 impl From<TeachingTip> for View {
6047 fn from(value: TeachingTip) -> Self {
6048 Self::native(value)
6049 }
6050 }
6051 impl From<DropDownButton> for Element {
6052 fn from(value: DropDownButton) -> Self {
6053 Self::DropDownButton(std::rc::Rc::new(value))
6054 }
6055 }
6056 impl From<DropDownButton> for View {
6057 fn from(value: DropDownButton) -> Self {
6058 Self::native(value)
6059 }
6060 }
6061 impl From<CommandBar> for Element {
6062 fn from(value: CommandBar) -> Self {
6063 Self::CommandBar(std::rc::Rc::new(value))
6064 }
6065 }
6066 impl From<CommandBar> for View {
6067 fn from(value: CommandBar) -> Self {
6068 Self::native(value)
6069 }
6070 }
6071 impl From<AppBarButton> for Element {
6072 fn from(value: AppBarButton) -> Self {
6073 Self::AppBarButton(std::rc::Rc::new(value))
6074 }
6075 }
6076 impl From<AppBarButton> for View {
6077 fn from(value: AppBarButton) -> Self {
6078 Self::native(value)
6079 }
6080 }
6081 impl From<AppBarSeparator> for Element {
6082 fn from(value: AppBarSeparator) -> Self {
6083 Self::AppBarSeparator(std::rc::Rc::new(value))
6084 }
6085 }
6086 impl From<AppBarSeparator> for View {
6087 fn from(value: AppBarSeparator) -> Self {
6088 Self::native(value)
6089 }
6090 }
6091 impl From<MenuBar> for Element {
6092 fn from(value: MenuBar) -> Self {
6093 Self::MenuBar(std::rc::Rc::new(value))
6094 }
6095 }
6096 impl From<MenuBar> for View {
6097 fn from(value: MenuBar) -> Self {
6098 Self::native(value)
6099 }
6100 }
6101 impl From<MenuBarItem> for Element {
6102 fn from(value: MenuBarItem) -> Self {
6103 Self::MenuBarItem(std::rc::Rc::new(value))
6104 }
6105 }
6106 impl From<MenuBarItem> for View {
6107 fn from(value: MenuBarItem) -> Self {
6108 Self::native(value)
6109 }
6110 }
6111 impl From<SplitButton> for Element {
6112 fn from(value: SplitButton) -> Self {
6113 Self::SplitButton(std::rc::Rc::new(value))
6114 }
6115 }
6116 impl From<SplitButton> for View {
6117 fn from(value: SplitButton) -> Self {
6118 Self::native(value)
6119 }
6120 }
6121 impl From<ColorPicker> for Element {
6122 fn from(value: ColorPicker) -> Self {
6123 Self::ColorPicker(std::rc::Rc::new(value))
6124 }
6125 }
6126 impl From<ColorPicker> for View {
6127 fn from(value: ColorPicker) -> Self {
6128 Self::native(value)
6129 }
6130 }
6131 impl From<DatePicker> for Element {
6132 fn from(value: DatePicker) -> Self {
6133 Self::DatePicker(std::rc::Rc::new(value))
6134 }
6135 }
6136 impl From<DatePicker> for View {
6137 fn from(value: DatePicker) -> Self {
6138 Self::native(value)
6139 }
6140 }
6141 impl From<TimePicker> for Element {
6142 fn from(value: TimePicker) -> Self {
6143 Self::TimePicker(std::rc::Rc::new(value))
6144 }
6145 }
6146 impl From<TimePicker> for View {
6147 fn from(value: TimePicker) -> Self {
6148 Self::native(value)
6149 }
6150 }
6151 impl From<CalendarDatePicker> for Element {
6152 fn from(value: CalendarDatePicker) -> Self {
6153 Self::CalendarDatePicker(std::rc::Rc::new(value))
6154 }
6155 }
6156 impl From<CalendarDatePicker> for View {
6157 fn from(value: CalendarDatePicker) -> Self {
6158 Self::native(value)
6159 }
6160 }
6161 impl From<ToolTip> for Element {
6162 fn from(value: ToolTip) -> Self {
6163 Self::ToolTip(std::rc::Rc::new(value))
6164 }
6165 }
6166 impl From<ToolTip> for View {
6167 fn from(value: ToolTip) -> Self {
6168 Self::native(value)
6169 }
6170 }
6171 impl From<ContentDialog> for Element {
6172 fn from(value: ContentDialog) -> Self {
6173 Self::ContentDialog(std::rc::Rc::new(value))
6174 }
6175 }
6176 impl From<ContentDialog> for View {
6177 fn from(value: ContentDialog) -> Self {
6178 let open = value.is_open;
6179 Self::content_dialog(value.into(), None, open)
6180 }
6181 }
6182 impl From<CalendarView> for Element {
6183 fn from(value: CalendarView) -> Self {
6184 Self::CalendarView(std::rc::Rc::new(value))
6185 }
6186 }
6187 impl From<CalendarView> for View {
6188 fn from(value: CalendarView) -> Self {
6189 Self::native(value)
6190 }
6191 }
6192 impl From<ListView> for Element {
6193 fn from(value: ListView) -> Self {
6194 Self::ListView(std::rc::Rc::new(value))
6195 }
6196 }
6197 impl From<ListView> for View {
6198 fn from(value: ListView) -> Self {
6199 Self::native(value)
6200 }
6201 }
6202 impl From<ListViewItem> for Element {
6203 fn from(value: ListViewItem) -> Self {
6204 Self::ListViewItem(std::rc::Rc::new(value))
6205 }
6206 }
6207 impl From<ListViewItem> for View {
6208 fn from(value: ListViewItem) -> Self {
6209 Self::native(value)
6210 }
6211 }
6212 impl From<TreeView> for Element {
6213 fn from(value: TreeView) -> Self {
6214 Self::TreeView(std::rc::Rc::new(value))
6215 }
6216 }
6217 impl From<TreeView> for View {
6218 fn from(value: TreeView) -> Self {
6219 Self::native(value)
6220 }
6221 }
6222 impl From<GridView> for Element {
6223 fn from(value: GridView) -> Self {
6224 Self::GridView(std::rc::Rc::new(value))
6225 }
6226 }
6227 impl From<GridView> for View {
6228 fn from(value: GridView) -> Self {
6229 Self::native(value)
6230 }
6231 }
6232 impl From<GridViewItem> for Element {
6233 fn from(value: GridViewItem) -> Self {
6234 Self::GridViewItem(std::rc::Rc::new(value))
6235 }
6236 }
6237 impl From<GridViewItem> for View {
6238 fn from(value: GridViewItem) -> Self {
6239 Self::native(value)
6240 }
6241 }
6242 impl From<RelativePanel> for Element {
6243 fn from(value: RelativePanel) -> Self {
6244 Self::RelativePanel(std::rc::Rc::new(value))
6245 }
6246 }
6247 impl From<RelativePanel> for View {
6248 fn from(value: RelativePanel) -> Self {
6249 Self::native(value)
6250 }
6251 }
6252 impl From<Canvas> for Element {
6253 fn from(value: Canvas) -> Self {
6254 Self::Canvas(std::rc::Rc::new(value))
6255 }
6256 }
6257 impl From<Canvas> for View {
6258 fn from(value: Canvas) -> Self {
6259 Self::native(value)
6260 }
6261 }
6262 impl From<RichEditBox> for Element {
6263 fn from(value: RichEditBox) -> Self {
6264 Self::RichEditBox(std::rc::Rc::new(value))
6265 }
6266 }
6267 impl From<RichEditBox> for View {
6268 fn from(value: RichEditBox) -> Self {
6269 Self::native(value)
6270 }
6271 }
6272 impl From<RichTextBlock> for Element {
6273 fn from(value: RichTextBlock) -> Self {
6274 Self::RichTextBlock(std::rc::Rc::new(value))
6275 }
6276 }
6277 impl From<RichTextBlock> for View {
6278 fn from(value: RichTextBlock) -> Self {
6279 Self::native(value)
6280 }
6281 }
6282 impl From<Viewbox> for Element {
6283 fn from(value: Viewbox) -> Self {
6284 Self::Viewbox(std::rc::Rc::new(value))
6285 }
6286 }
6287 impl From<Viewbox> for View {
6288 fn from(value: Viewbox) -> Self {
6289 Self::native(value)
6290 }
6291 }
6292 impl From<WebView2> for Element {
6293 fn from(value: WebView2) -> Self {
6294 Self::WebView2(std::rc::Rc::new(value))
6295 }
6296 }
6297 impl From<WebView2> for View {
6298 fn from(value: WebView2) -> Self {
6299 Self::native(value)
6300 }
6301 }
6302 impl From<SwapChainPanel> for Element {
6303 fn from(value: SwapChainPanel) -> Self {
6304 Self::SwapChainPanel(std::rc::Rc::new(value))
6305 }
6306 }
6307 impl From<SwapChainPanel> for View {
6308 fn from(value: SwapChainPanel) -> Self {
6309 Self::native(value)
6310 }
6311 }
6312 impl ElementPartsExt for Element {
6313 fn kind(&self) -> MountedKind {
6314 match self {
6315 Self::TextBlock(_) => MountedKind::TextBlock,
6316 Self::Button(_) => MountedKind::Button,
6317 Self::HyperlinkButton(_) => MountedKind::HyperlinkButton,
6318 Self::RepeatButton(_) => MountedKind::RepeatButton,
6319 Self::Border(_) => MountedKind::Border,
6320 Self::BreadcrumbBar(_) => MountedKind::BreadcrumbBar,
6321 Self::StackPanel(_) => MountedKind::StackPanel,
6322 Self::VariableSizedWrapGrid(_) => MountedKind::VariableSizedWrapGrid,
6323 Self::Grid(_) => MountedKind::Grid,
6324 Self::TextBox(_) => MountedKind::TextBox,
6325 Self::AutoSuggestBox(_) => MountedKind::AutoSuggestBox,
6326 Self::PasswordBox(_) => MountedKind::PasswordBox,
6327 Self::NumberBox(_) => MountedKind::NumberBox,
6328 Self::Slider(_) => MountedKind::Slider,
6329 Self::TitleBar(_) => MountedKind::TitleBar,
6330 Self::NavigationView(_) => MountedKind::NavigationView,
6331 Self::NavigationViewItem(_) => MountedKind::NavigationViewItem,
6332 Self::SplitView(_) => MountedKind::SplitView,
6333 Self::ProgressBar(_) => MountedKind::ProgressBar,
6334 Self::ToggleSwitch(_) => MountedKind::ToggleSwitch,
6335 Self::CheckBox(_) => MountedKind::CheckBox,
6336 Self::ToggleButton(_) => MountedKind::ToggleButton,
6337 Self::RadioButton(_) => MountedKind::RadioButton,
6338 Self::RadioButtons(_) => MountedKind::RadioButtons,
6339 Self::ItemsRepeater(_) => MountedKind::ItemsRepeater,
6340 Self::InfoBadge(_) => MountedKind::InfoBadge,
6341 Self::InfoBar(_) => MountedKind::InfoBar,
6342 Self::PersonPicture(_) => MountedKind::PersonPicture,
6343 Self::ScrollViewer(_) => MountedKind::ScrollViewer,
6344 Self::ScrollView(_) => MountedKind::ScrollView,
6345 Self::Image(_) => MountedKind::Image,
6346 Self::ProgressRing(_) => MountedKind::ProgressRing,
6347 Self::ListBox(_) => MountedKind::ListBox,
6348 Self::Rectangle(_) => MountedKind::Rectangle,
6349 Self::Ellipse(_) => MountedKind::Ellipse,
6350 Self::Line(_) => MountedKind::Line,
6351 Self::SymbolIcon(_) => MountedKind::SymbolIcon,
6352 Self::ImageIcon(_) => MountedKind::ImageIcon,
6353 Self::FontIcon(_) => MountedKind::FontIcon,
6354 Self::BitmapIcon(_) => MountedKind::BitmapIcon,
6355 Self::PathIcon(_) => MountedKind::PathIcon,
6356 Self::ListBoxItem(_) => MountedKind::ListBoxItem,
6357 Self::RatingControl(_) => MountedKind::RatingControl,
6358 Self::Expander(_) => MountedKind::Expander,
6359 Self::ComboBox(_) => MountedKind::ComboBox,
6360 Self::Pivot(_) => MountedKind::Pivot,
6361 Self::PivotItem(_) => MountedKind::PivotItem,
6362 Self::FlipView(_) => MountedKind::FlipView,
6363 Self::SelectorBar(_) => MountedKind::SelectorBar,
6364 Self::SelectorBarItem(_) => MountedKind::SelectorBarItem,
6365 Self::TabView(_) => MountedKind::TabView,
6366 Self::TabViewItem(_) => MountedKind::TabViewItem,
6367 Self::TeachingTip(_) => MountedKind::TeachingTip,
6368 Self::DropDownButton(_) => MountedKind::DropDownButton,
6369 Self::CommandBar(_) => MountedKind::CommandBar,
6370 Self::AppBarButton(_) => MountedKind::AppBarButton,
6371 Self::AppBarSeparator(_) => MountedKind::AppBarSeparator,
6372 Self::MenuBar(_) => MountedKind::MenuBar,
6373 Self::MenuBarItem(_) => MountedKind::MenuBarItem,
6374 Self::SplitButton(_) => MountedKind::SplitButton,
6375 Self::ColorPicker(_) => MountedKind::ColorPicker,
6376 Self::DatePicker(_) => MountedKind::DatePicker,
6377 Self::TimePicker(_) => MountedKind::TimePicker,
6378 Self::CalendarDatePicker(_) => MountedKind::CalendarDatePicker,
6379 Self::ToolTip(_) => MountedKind::ToolTip,
6380 Self::ContentDialog(_) => MountedKind::ContentDialog,
6381 Self::CalendarView(_) => MountedKind::CalendarView,
6382 Self::ListView(_) => MountedKind::ListView,
6383 Self::ListViewItem(_) => MountedKind::ListViewItem,
6384 Self::TreeView(_) => MountedKind::TreeView,
6385 Self::GridView(_) => MountedKind::GridView,
6386 Self::GridViewItem(_) => MountedKind::GridViewItem,
6387 Self::RelativePanel(_) => MountedKind::RelativePanel,
6388 Self::Canvas(_) => MountedKind::Canvas,
6389 Self::RichEditBox(_) => MountedKind::RichEditBox,
6390 Self::RichTextBlock(_) => MountedKind::RichTextBlock,
6391 Self::Viewbox(_) => MountedKind::Viewbox,
6392 Self::WebView2(_) => MountedKind::WebView2,
6393 Self::SwapChainPanel(_) => MountedKind::SwapChainPanel,
6394 }
6395 }
6396 fn into_parts(self) -> ElementParts {
6397 match self {
6398 Self::TextBlock(value) => {
6399 let value = std::rc::Rc::unwrap_or_clone(value);
6400 let TextBlock {
6401 text,
6402 text_wrapping,
6403 font_size,
6404 font_weight,
6405 is_text_selection_enabled,
6406 max_lines,
6407 text_trimming,
6408 foreground,
6409 element_state,
6410 } = value;
6411 ElementParts {
6412 kind: MountedKind::TextBlock,
6413 props: MountedProps::TextBlock(std::rc::Rc::new(TextBlockMountedProps {
6414 text,
6415 text_wrapping,
6416 font_size,
6417 font_weight,
6418 is_text_selection_enabled,
6419 max_lines,
6420 text_trimming,
6421 foreground,
6422 })),
6423 reference: None,
6424 element_state,
6425 window_title_bar: None,
6426 structure: ElementStructure::None,
6427 }
6428 }
6429 Self::Button(value) => {
6430 let value = std::rc::Rc::unwrap_or_clone(value);
6431 let Button {
6432 is_enabled,
6433 horizontal_content_alignment,
6434 vertical_content_alignment,
6435 resource_overrides,
6436 style,
6437 key_accelerators,
6438 on_click,
6439 reference,
6440 element_state,
6441 content,
6442 } = value;
6443 ElementParts {
6444 kind: MountedKind::Button,
6445 props: MountedProps::Button(std::rc::Rc::new(ButtonMountedProps {
6446 is_enabled,
6447 horizontal_content_alignment,
6448 vertical_content_alignment,
6449 resource_overrides,
6450 style,
6451 key_accelerators,
6452 on_click,
6453 })),
6454 reference,
6455 element_state,
6456 window_title_bar: None,
6457 structure: ElementStructure::Content(content.map(|element| *element)),
6458 }
6459 }
6460 Self::HyperlinkButton(value) => {
6461 let value = std::rc::Rc::unwrap_or_clone(value);
6462 let HyperlinkButton {
6463 navigate_uri,
6464 is_enabled,
6465 on_click,
6466 reference,
6467 element_state,
6468 content,
6469 } = value;
6470 ElementParts {
6471 kind: MountedKind::HyperlinkButton,
6472 props: MountedProps::HyperlinkButton(std::rc::Rc::new(
6473 HyperlinkButtonMountedProps {
6474 navigate_uri,
6475 is_enabled,
6476 on_click,
6477 },
6478 )),
6479 reference,
6480 element_state,
6481 window_title_bar: None,
6482 structure: ElementStructure::Content(content.map(|element| *element)),
6483 }
6484 }
6485 Self::RepeatButton(value) => {
6486 let value = std::rc::Rc::unwrap_or_clone(value);
6487 let RepeatButton {
6488 delay,
6489 interval,
6490 is_enabled,
6491 on_click,
6492 element_state,
6493 content,
6494 } = value;
6495 ElementParts {
6496 kind: MountedKind::RepeatButton,
6497 props: MountedProps::RepeatButton(std::rc::Rc::new(
6498 RepeatButtonMountedProps {
6499 delay,
6500 interval,
6501 is_enabled,
6502 on_click,
6503 },
6504 )),
6505 reference: None,
6506 element_state,
6507 window_title_bar: None,
6508 structure: ElementStructure::Content(content.map(|element| *element)),
6509 }
6510 }
6511 Self::Border(value) => {
6512 let value = std::rc::Rc::unwrap_or_clone(value);
6513 let Border {
6514 padding,
6515 border_thickness,
6516 corner_radius,
6517 background,
6518 border_brush,
6519 opacity_transition,
6520 scale,
6521 scale_transition,
6522 capture_pointer_on_press,
6523 drop_policy,
6524 events,
6525 element_state,
6526 content,
6527 } = value;
6528 ElementParts {
6529 kind: MountedKind::Border,
6530 props: MountedProps::Border(std::rc::Rc::new(BorderMountedProps {
6531 padding,
6532 border_thickness,
6533 corner_radius,
6534 background,
6535 border_brush,
6536 opacity_transition,
6537 scale,
6538 scale_transition,
6539 capture_pointer_on_press,
6540 drop_policy,
6541 events,
6542 })),
6543 reference: None,
6544 element_state,
6545 window_title_bar: None,
6546 structure: ElementStructure::Content(content.map(|element| *element)),
6547 }
6548 }
6549 Self::BreadcrumbBar(value) => {
6550 let value = std::rc::Rc::unwrap_or_clone(value);
6551 let BreadcrumbBar {
6552 items_source,
6553 on_item_clicked,
6554 element_state,
6555 } = value;
6556 ElementParts {
6557 kind: MountedKind::BreadcrumbBar,
6558 props: MountedProps::BreadcrumbBar(std::rc::Rc::new(
6559 BreadcrumbBarMountedProps {
6560 items_source,
6561 on_item_clicked,
6562 },
6563 )),
6564 reference: None,
6565 element_state,
6566 window_title_bar: None,
6567 structure: ElementStructure::None,
6568 }
6569 }
6570 Self::StackPanel(value) => {
6571 let value = std::rc::Rc::unwrap_or_clone(value);
6572 let StackPanel {
6573 orientation,
6574 spacing,
6575 element_state,
6576 children,
6577 } = value;
6578 ElementParts {
6579 kind: MountedKind::StackPanel,
6580 props: MountedProps::StackPanel(std::rc::Rc::new(StackPanelMountedProps {
6581 orientation,
6582 spacing,
6583 })),
6584 reference: None,
6585 element_state,
6586 window_title_bar: None,
6587 structure: ElementStructure::Children(children),
6588 }
6589 }
6590 Self::VariableSizedWrapGrid(value) => {
6591 let value = std::rc::Rc::unwrap_or_clone(value);
6592 let VariableSizedWrapGrid {
6593 item_width,
6594 item_height,
6595 orientation,
6596 element_state,
6597 children,
6598 } = value;
6599 ElementParts {
6600 kind: MountedKind::VariableSizedWrapGrid,
6601 props: MountedProps::VariableSizedWrapGrid(std::rc::Rc::new(
6602 VariableSizedWrapGridMountedProps {
6603 item_width,
6604 item_height,
6605 orientation,
6606 },
6607 )),
6608 reference: None,
6609 element_state,
6610 window_title_bar: None,
6611 structure: ElementStructure::Children(children),
6612 }
6613 }
6614 Self::Grid(value) => {
6615 let value = std::rc::Rc::unwrap_or_clone(value);
6616 let Grid {
6617 row_spacing,
6618 column_spacing,
6619 key_accelerators,
6620 background,
6621 rows,
6622 columns,
6623 reference,
6624 element_state,
6625 children,
6626 } = value;
6627 ElementParts {
6628 kind: MountedKind::Grid,
6629 props: MountedProps::Grid(std::rc::Rc::new(GridMountedProps {
6630 row_spacing,
6631 column_spacing,
6632 key_accelerators,
6633 background,
6634 rows,
6635 columns,
6636 })),
6637 reference,
6638 element_state,
6639 window_title_bar: None,
6640 structure: ElementStructure::Children(children),
6641 }
6642 }
6643 Self::TextBox(value) => {
6644 let value = std::rc::Rc::unwrap_or_clone(value);
6645 let TextBox {
6646 text,
6647 placeholder_text,
6648 is_enabled,
6649 accepts_return,
6650 text_wrapping,
6651 background,
6652 border_brush,
6653 border_thickness,
6654 on_text_changed,
6655 reference,
6656 element_state,
6657 } = value;
6658 ElementParts {
6659 kind: MountedKind::TextBox,
6660 props: MountedProps::TextBox(std::rc::Rc::new(TextBoxMountedProps {
6661 text,
6662 placeholder_text,
6663 is_enabled,
6664 accepts_return,
6665 text_wrapping,
6666 background,
6667 border_brush,
6668 border_thickness,
6669 on_text_changed,
6670 })),
6671 reference,
6672 element_state,
6673 window_title_bar: None,
6674 structure: ElementStructure::None,
6675 }
6676 }
6677 Self::AutoSuggestBox(value) => {
6678 let value = std::rc::Rc::unwrap_or_clone(value);
6679 let AutoSuggestBox {
6680 text,
6681 items_source,
6682 placeholder_text,
6683 is_enabled,
6684 events,
6685 reference,
6686 element_state,
6687 } = value;
6688 ElementParts {
6689 kind: MountedKind::AutoSuggestBox,
6690 props: MountedProps::AutoSuggestBox(std::rc::Rc::new(
6691 AutoSuggestBoxMountedProps {
6692 text,
6693 items_source,
6694 placeholder_text,
6695 is_enabled,
6696 events,
6697 },
6698 )),
6699 reference,
6700 element_state,
6701 window_title_bar: None,
6702 structure: ElementStructure::None,
6703 }
6704 }
6705 Self::PasswordBox(value) => {
6706 let value = std::rc::Rc::unwrap_or_clone(value);
6707 let PasswordBox {
6708 password,
6709 placeholder_text,
6710 password_reveal_mode,
6711 is_enabled,
6712 on_password_changed,
6713 reference,
6714 element_state,
6715 } = value;
6716 ElementParts {
6717 kind: MountedKind::PasswordBox,
6718 props: MountedProps::PasswordBox(std::rc::Rc::new(
6719 PasswordBoxMountedProps {
6720 password,
6721 placeholder_text,
6722 password_reveal_mode,
6723 is_enabled,
6724 on_password_changed,
6725 },
6726 )),
6727 reference,
6728 element_state,
6729 window_title_bar: None,
6730 structure: ElementStructure::None,
6731 }
6732 }
6733 Self::NumberBox(value) => {
6734 let value = std::rc::Rc::unwrap_or_clone(value);
6735 let NumberBox {
6736 minimum,
6737 maximum,
6738 value,
6739 is_enabled,
6740 on_value_changed,
6741 reference,
6742 element_state,
6743 } = value;
6744 ElementParts {
6745 kind: MountedKind::NumberBox,
6746 props: MountedProps::NumberBox(std::rc::Rc::new(NumberBoxMountedProps {
6747 minimum,
6748 maximum,
6749 value,
6750 is_enabled,
6751 on_value_changed,
6752 })),
6753 reference,
6754 element_state,
6755 window_title_bar: None,
6756 structure: ElementStructure::None,
6757 }
6758 }
6759 Self::Slider(value) => {
6760 let value = std::rc::Rc::unwrap_or_clone(value);
6761 let Slider {
6762 minimum,
6763 maximum,
6764 value,
6765 is_enabled,
6766 step_frequency,
6767 orientation,
6768 on_value_changed,
6769 reference,
6770 element_state,
6771 } = value;
6772 ElementParts {
6773 kind: MountedKind::Slider,
6774 props: MountedProps::Slider(std::rc::Rc::new(SliderMountedProps {
6775 minimum,
6776 maximum,
6777 value,
6778 is_enabled,
6779 step_frequency,
6780 orientation,
6781 on_value_changed,
6782 })),
6783 reference,
6784 element_state,
6785 window_title_bar: None,
6786 structure: ElementStructure::None,
6787 }
6788 }
6789 Self::TitleBar(value) => {
6790 let value = std::rc::Rc::unwrap_or_clone(value);
6791 let TitleBar {
6792 title,
6793 subtitle,
6794 is_back_button_visible,
6795 is_back_button_enabled,
6796 is_pane_toggle_button_visible,
6797 events,
6798 element_state,
6799 preferred_height,
6800 } = value;
6801 ElementParts {
6802 kind: MountedKind::TitleBar,
6803 props: MountedProps::TitleBar(std::rc::Rc::new(TitleBarMountedProps {
6804 title,
6805 subtitle,
6806 is_back_button_visible,
6807 is_back_button_enabled,
6808 is_pane_toggle_button_visible,
6809 events,
6810 })),
6811 reference: None,
6812 element_state,
6813 window_title_bar: Some(preferred_height),
6814 structure: ElementStructure::None,
6815 }
6816 }
6817 Self::NavigationView(value) => {
6818 let value = std::rc::Rc::unwrap_or_clone(value);
6819 let NavigationView {
6820 is_enabled,
6821 pane_display_mode,
6822 is_pane_toggle_button_visible,
6823 is_back_button_visible,
6824 is_settings_visible,
6825 always_show_header,
6826 pane_title,
6827 open_pane_length,
6828 is_pane_open,
6829 events,
6830 element_state,
6831 } = value;
6832 ElementParts {
6833 kind: MountedKind::NavigationView,
6834 props: MountedProps::NavigationView(std::rc::Rc::new(
6835 NavigationViewMountedProps {
6836 is_enabled,
6837 pane_display_mode,
6838 is_pane_toggle_button_visible,
6839 is_back_button_visible,
6840 is_settings_visible,
6841 always_show_header,
6842 pane_title,
6843 open_pane_length,
6844 is_pane_open,
6845 events,
6846 },
6847 )),
6848 reference: None,
6849 element_state,
6850 window_title_bar: None,
6851 structure: ElementStructure::None,
6852 }
6853 }
6854 Self::NavigationViewItem(value) => {
6855 let value = std::rc::Rc::unwrap_or_clone(value);
6856 let NavigationViewItem {
6857 tag,
6858 is_selected,
6859 selects_on_invoked,
6860 is_expanded,
6861 element_state,
6862 } = value;
6863 ElementParts {
6864 kind: MountedKind::NavigationViewItem,
6865 props: MountedProps::NavigationViewItem(std::rc::Rc::new(
6866 NavigationViewItemMountedProps {
6867 tag,
6868 is_selected,
6869 selects_on_invoked,
6870 is_expanded,
6871 },
6872 )),
6873 reference: None,
6874 element_state,
6875 window_title_bar: None,
6876 structure: ElementStructure::None,
6877 }
6878 }
6879 Self::SplitView(value) => {
6880 let value = std::rc::Rc::unwrap_or_clone(value);
6881 let SplitView {
6882 open_pane_length,
6883 compact_pane_length,
6884 display_mode,
6885 is_pane_open,
6886 on_pane_closed,
6887 element_state,
6888 } = value;
6889 ElementParts {
6890 kind: MountedKind::SplitView,
6891 props: MountedProps::SplitView(std::rc::Rc::new(SplitViewMountedProps {
6892 open_pane_length,
6893 compact_pane_length,
6894 display_mode,
6895 is_pane_open,
6896 on_pane_closed,
6897 })),
6898 reference: None,
6899 element_state,
6900 window_title_bar: None,
6901 structure: ElementStructure::None,
6902 }
6903 }
6904 Self::ProgressBar(value) => {
6905 let value = std::rc::Rc::unwrap_or_clone(value);
6906 let ProgressBar {
6907 minimum,
6908 maximum,
6909 value,
6910 is_indeterminate,
6911 show_error,
6912 show_paused,
6913 is_enabled,
6914 element_state,
6915 } = value;
6916 ElementParts {
6917 kind: MountedKind::ProgressBar,
6918 props: MountedProps::ProgressBar(std::rc::Rc::new(
6919 ProgressBarMountedProps {
6920 minimum,
6921 maximum,
6922 value,
6923 is_indeterminate,
6924 show_error,
6925 show_paused,
6926 is_enabled,
6927 },
6928 )),
6929 reference: None,
6930 element_state,
6931 window_title_bar: None,
6932 structure: ElementStructure::None,
6933 }
6934 }
6935 Self::ToggleSwitch(value) => {
6936 let value = std::rc::Rc::unwrap_or_clone(value);
6937 let ToggleSwitch {
6938 is_on,
6939 is_enabled,
6940 on_toggled,
6941 reference,
6942 element_state,
6943 } = value;
6944 ElementParts {
6945 kind: MountedKind::ToggleSwitch,
6946 props: MountedProps::ToggleSwitch(std::rc::Rc::new(
6947 ToggleSwitchMountedProps {
6948 is_on,
6949 is_enabled,
6950 on_toggled,
6951 },
6952 )),
6953 reference,
6954 element_state,
6955 window_title_bar: None,
6956 structure: ElementStructure::None,
6957 }
6958 }
6959 Self::CheckBox(value) => {
6960 let value = std::rc::Rc::unwrap_or_clone(value);
6961 let CheckBox {
6962 is_checked,
6963 is_enabled,
6964 on_is_checked_changed,
6965 reference,
6966 element_state,
6967 content,
6968 } = value;
6969 ElementParts {
6970 kind: MountedKind::CheckBox,
6971 props: MountedProps::CheckBox(std::rc::Rc::new(CheckBoxMountedProps {
6972 is_checked,
6973 is_enabled,
6974 on_is_checked_changed,
6975 })),
6976 reference,
6977 element_state,
6978 window_title_bar: None,
6979 structure: ElementStructure::Content(content.map(|element| *element)),
6980 }
6981 }
6982 Self::ToggleButton(value) => {
6983 let value = std::rc::Rc::unwrap_or_clone(value);
6984 let ToggleButton {
6985 is_checked,
6986 is_enabled,
6987 on_is_checked_changed,
6988 reference,
6989 element_state,
6990 content,
6991 } = value;
6992 ElementParts {
6993 kind: MountedKind::ToggleButton,
6994 props: MountedProps::ToggleButton(std::rc::Rc::new(
6995 ToggleButtonMountedProps {
6996 is_checked,
6997 is_enabled,
6998 on_is_checked_changed,
6999 },
7000 )),
7001 reference,
7002 element_state,
7003 window_title_bar: None,
7004 structure: ElementStructure::Content(content.map(|element| *element)),
7005 }
7006 }
7007 Self::RadioButton(value) => {
7008 let value = std::rc::Rc::unwrap_or_clone(value);
7009 let RadioButton {
7010 group_name,
7011 is_checked,
7012 is_enabled,
7013 on_checked,
7014 reference,
7015 element_state,
7016 content,
7017 } = value;
7018 ElementParts {
7019 kind: MountedKind::RadioButton,
7020 props: MountedProps::RadioButton(std::rc::Rc::new(
7021 RadioButtonMountedProps {
7022 group_name,
7023 is_checked,
7024 is_enabled,
7025 on_checked,
7026 },
7027 )),
7028 reference,
7029 element_state,
7030 window_title_bar: None,
7031 structure: ElementStructure::Content(content.map(|element| *element)),
7032 }
7033 }
7034 Self::RadioButtons(value) => {
7035 let value = std::rc::Rc::unwrap_or_clone(value);
7036 let RadioButtons {
7037 items_source,
7038 selected_index,
7039 max_columns,
7040 on_selection_changed,
7041 element_state,
7042 } = value;
7043 ElementParts {
7044 kind: MountedKind::RadioButtons,
7045 props: MountedProps::RadioButtons(std::rc::Rc::new(
7046 RadioButtonsMountedProps {
7047 items_source,
7048 selected_index,
7049 max_columns,
7050 on_selection_changed,
7051 },
7052 )),
7053 reference: None,
7054 element_state,
7055 window_title_bar: None,
7056 structure: ElementStructure::None,
7057 }
7058 }
7059 Self::ItemsRepeater(value) => {
7060 let value = std::rc::Rc::unwrap_or_clone(value);
7061 let ItemsRepeater {
7062 element_state,
7063 items,
7064 } = value;
7065 ElementParts {
7066 kind: MountedKind::ItemsRepeater,
7067 props: MountedProps::ItemsRepeater(std::rc::Rc::new(
7068 ItemsRepeaterMountedProps {},
7069 )),
7070 reference: None,
7071 element_state,
7072 window_title_bar: None,
7073 structure: ElementStructure::Virtual(items),
7074 }
7075 }
7076 Self::InfoBadge(value) => {
7077 let value = std::rc::Rc::unwrap_or_clone(value);
7078 let InfoBadge {
7079 value,
7080 element_state,
7081 } = value;
7082 ElementParts {
7083 kind: MountedKind::InfoBadge,
7084 props: MountedProps::InfoBadge(std::rc::Rc::new(InfoBadgeMountedProps {
7085 value,
7086 })),
7087 reference: None,
7088 element_state,
7089 window_title_bar: None,
7090 structure: ElementStructure::None,
7091 }
7092 }
7093 Self::InfoBar(value) => {
7094 let value = std::rc::Rc::unwrap_or_clone(value);
7095 let InfoBar {
7096 title,
7097 message,
7098 severity,
7099 is_open,
7100 is_closable,
7101 on_closed,
7102 element_state,
7103 } = value;
7104 ElementParts {
7105 kind: MountedKind::InfoBar,
7106 props: MountedProps::InfoBar(std::rc::Rc::new(InfoBarMountedProps {
7107 title,
7108 message,
7109 severity,
7110 is_open,
7111 is_closable,
7112 on_closed,
7113 })),
7114 reference: None,
7115 element_state,
7116 window_title_bar: None,
7117 structure: ElementStructure::None,
7118 }
7119 }
7120 Self::PersonPicture(value) => {
7121 let value = std::rc::Rc::unwrap_or_clone(value);
7122 let PersonPicture {
7123 display_name,
7124 initials,
7125 element_state,
7126 } = value;
7127 ElementParts {
7128 kind: MountedKind::PersonPicture,
7129 props: MountedProps::PersonPicture(std::rc::Rc::new(
7130 PersonPictureMountedProps {
7131 display_name,
7132 initials,
7133 },
7134 )),
7135 reference: None,
7136 element_state,
7137 window_title_bar: None,
7138 structure: ElementStructure::None,
7139 }
7140 }
7141 Self::ScrollViewer(value) => {
7142 let value = std::rc::Rc::unwrap_or_clone(value);
7143 let ScrollViewer {
7144 horizontal_scroll_bar_visibility,
7145 vertical_scroll_bar_visibility,
7146 element_state,
7147 content,
7148 } = value;
7149 ElementParts {
7150 kind: MountedKind::ScrollViewer,
7151 props: MountedProps::ScrollViewer(std::rc::Rc::new(
7152 ScrollViewerMountedProps {
7153 horizontal_scroll_bar_visibility,
7154 vertical_scroll_bar_visibility,
7155 },
7156 )),
7157 reference: None,
7158 element_state,
7159 window_title_bar: None,
7160 structure: ElementStructure::Content(content.map(|element| *element)),
7161 }
7162 }
7163 Self::ScrollView(value) => {
7164 let value = std::rc::Rc::unwrap_or_clone(value);
7165 let ScrollView {
7166 horizontal_scroll_bar_visibility,
7167 vertical_scroll_bar_visibility,
7168 element_state,
7169 content,
7170 } = value;
7171 ElementParts {
7172 kind: MountedKind::ScrollView,
7173 props: MountedProps::ScrollView(std::rc::Rc::new(ScrollViewMountedProps {
7174 horizontal_scroll_bar_visibility,
7175 vertical_scroll_bar_visibility,
7176 })),
7177 reference: None,
7178 element_state,
7179 window_title_bar: None,
7180 structure: ElementStructure::Content(content.map(|element| *element)),
7181 }
7182 }
7183 Self::Image(value) => {
7184 let value = std::rc::Rc::unwrap_or_clone(value);
7185 let Image {
7186 source,
7187 stretch,
7188 events,
7189 reference,
7190 element_state,
7191 } = value;
7192 ElementParts {
7193 kind: MountedKind::Image,
7194 props: MountedProps::Image(std::rc::Rc::new(ImageMountedProps {
7195 source,
7196 stretch,
7197 events,
7198 })),
7199 reference,
7200 element_state,
7201 window_title_bar: None,
7202 structure: ElementStructure::None,
7203 }
7204 }
7205 Self::ProgressRing(value) => {
7206 let value = std::rc::Rc::unwrap_or_clone(value);
7207 let ProgressRing {
7208 minimum,
7209 maximum,
7210 value,
7211 is_indeterminate,
7212 is_active,
7213 is_enabled,
7214 element_state,
7215 } = value;
7216 ElementParts {
7217 kind: MountedKind::ProgressRing,
7218 props: MountedProps::ProgressRing(std::rc::Rc::new(
7219 ProgressRingMountedProps {
7220 minimum,
7221 maximum,
7222 value,
7223 is_indeterminate,
7224 is_active,
7225 is_enabled,
7226 },
7227 )),
7228 reference: None,
7229 element_state,
7230 window_title_bar: None,
7231 structure: ElementStructure::None,
7232 }
7233 }
7234 Self::ListBox(value) => {
7235 let value = std::rc::Rc::unwrap_or_clone(value);
7236 let ListBox {
7237 is_enabled,
7238 on_selected_tag_changed,
7239 element_state,
7240 } = value;
7241 ElementParts {
7242 kind: MountedKind::ListBox,
7243 props: MountedProps::ListBox(std::rc::Rc::new(ListBoxMountedProps {
7244 is_enabled,
7245 on_selected_tag_changed,
7246 })),
7247 reference: None,
7248 element_state,
7249 window_title_bar: None,
7250 structure: ElementStructure::None,
7251 }
7252 }
7253 Self::Rectangle(value) => {
7254 let value = std::rc::Rc::unwrap_or_clone(value);
7255 let Rectangle {
7256 fill,
7257 stroke,
7258 stroke_thickness,
7259 radius_x,
7260 radius_y,
7261 element_state,
7262 } = value;
7263 ElementParts {
7264 kind: MountedKind::Rectangle,
7265 props: MountedProps::Rectangle(std::rc::Rc::new(RectangleMountedProps {
7266 fill,
7267 stroke,
7268 stroke_thickness,
7269 radius_x,
7270 radius_y,
7271 })),
7272 reference: None,
7273 element_state,
7274 window_title_bar: None,
7275 structure: ElementStructure::None,
7276 }
7277 }
7278 Self::Ellipse(value) => {
7279 let value = std::rc::Rc::unwrap_or_clone(value);
7280 let Ellipse {
7281 fill,
7282 stroke,
7283 stroke_thickness,
7284 element_state,
7285 } = value;
7286 ElementParts {
7287 kind: MountedKind::Ellipse,
7288 props: MountedProps::Ellipse(std::rc::Rc::new(EllipseMountedProps {
7289 fill,
7290 stroke,
7291 stroke_thickness,
7292 })),
7293 reference: None,
7294 element_state,
7295 window_title_bar: None,
7296 structure: ElementStructure::None,
7297 }
7298 }
7299 Self::Line(value) => {
7300 let value = std::rc::Rc::unwrap_or_clone(value);
7301 let Line {
7302 stroke,
7303 stroke_thickness,
7304 x1,
7305 y1,
7306 x2,
7307 y2,
7308 element_state,
7309 } = value;
7310 ElementParts {
7311 kind: MountedKind::Line,
7312 props: MountedProps::Line(std::rc::Rc::new(LineMountedProps {
7313 stroke,
7314 stroke_thickness,
7315 x1,
7316 y1,
7317 x2,
7318 y2,
7319 })),
7320 reference: None,
7321 element_state,
7322 window_title_bar: None,
7323 structure: ElementStructure::None,
7324 }
7325 }
7326 Self::SymbolIcon(value) => {
7327 let value = std::rc::Rc::unwrap_or_clone(value);
7328 let SymbolIcon {
7329 symbol,
7330 element_state,
7331 } = value;
7332 ElementParts {
7333 kind: MountedKind::SymbolIcon,
7334 props: MountedProps::SymbolIcon(std::rc::Rc::new(SymbolIconMountedProps {
7335 symbol,
7336 })),
7337 reference: None,
7338 element_state,
7339 window_title_bar: None,
7340 structure: ElementStructure::None,
7341 }
7342 }
7343 Self::ImageIcon(value) => {
7344 let value = std::rc::Rc::unwrap_or_clone(value);
7345 let ImageIcon {
7346 source,
7347 element_state,
7348 } = value;
7349 ElementParts {
7350 kind: MountedKind::ImageIcon,
7351 props: MountedProps::ImageIcon(std::rc::Rc::new(ImageIconMountedProps {
7352 source,
7353 })),
7354 reference: None,
7355 element_state,
7356 window_title_bar: None,
7357 structure: ElementStructure::None,
7358 }
7359 }
7360 Self::FontIcon(value) => {
7361 let value = std::rc::Rc::unwrap_or_clone(value);
7362 let FontIcon {
7363 glyph,
7364 element_state,
7365 } = value;
7366 ElementParts {
7367 kind: MountedKind::FontIcon,
7368 props: MountedProps::FontIcon(std::rc::Rc::new(FontIconMountedProps {
7369 glyph,
7370 })),
7371 reference: None,
7372 element_state,
7373 window_title_bar: None,
7374 structure: ElementStructure::None,
7375 }
7376 }
7377 Self::BitmapIcon(value) => {
7378 let value = std::rc::Rc::unwrap_or_clone(value);
7379 let BitmapIcon {
7380 uri_source,
7381 show_as_monochrome,
7382 element_state,
7383 } = value;
7384 ElementParts {
7385 kind: MountedKind::BitmapIcon,
7386 props: MountedProps::BitmapIcon(std::rc::Rc::new(BitmapIconMountedProps {
7387 uri_source,
7388 show_as_monochrome,
7389 })),
7390 reference: None,
7391 element_state,
7392 window_title_bar: None,
7393 structure: ElementStructure::None,
7394 }
7395 }
7396 Self::PathIcon(value) => {
7397 let value = std::rc::Rc::unwrap_or_clone(value);
7398 let PathIcon {
7399 data,
7400 element_state,
7401 } = value;
7402 ElementParts {
7403 kind: MountedKind::PathIcon,
7404 props: MountedProps::PathIcon(std::rc::Rc::new(PathIconMountedProps {
7405 data,
7406 })),
7407 reference: None,
7408 element_state,
7409 window_title_bar: None,
7410 structure: ElementStructure::None,
7411 }
7412 }
7413 Self::ListBoxItem(value) => {
7414 let value = std::rc::Rc::unwrap_or_clone(value);
7415 let ListBoxItem {
7416 tag,
7417 is_selected,
7418 element_state,
7419 content,
7420 } = value;
7421 ElementParts {
7422 kind: MountedKind::ListBoxItem,
7423 props: MountedProps::ListBoxItem(std::rc::Rc::new(
7424 ListBoxItemMountedProps { tag, is_selected },
7425 )),
7426 reference: None,
7427 element_state,
7428 window_title_bar: None,
7429 structure: ElementStructure::Content(content.map(|element| *element)),
7430 }
7431 }
7432 Self::RatingControl(value) => {
7433 let value = std::rc::Rc::unwrap_or_clone(value);
7434 let RatingControl {
7435 max_rating,
7436 value,
7437 caption,
7438 is_read_only,
7439 on_value_changed,
7440 reference,
7441 element_state,
7442 } = value;
7443 ElementParts {
7444 kind: MountedKind::RatingControl,
7445 props: MountedProps::RatingControl(std::rc::Rc::new(
7446 RatingControlMountedProps {
7447 max_rating,
7448 value,
7449 caption,
7450 is_read_only,
7451 on_value_changed,
7452 },
7453 )),
7454 reference,
7455 element_state,
7456 window_title_bar: None,
7457 structure: ElementStructure::None,
7458 }
7459 }
7460 Self::Expander(value) => {
7461 let value = std::rc::Rc::unwrap_or_clone(value);
7462 let Expander {
7463 is_expanded,
7464 on_is_expanded_changed,
7465 element_state,
7466 } = value;
7467 ElementParts {
7468 kind: MountedKind::Expander,
7469 props: MountedProps::Expander(std::rc::Rc::new(ExpanderMountedProps {
7470 is_expanded,
7471 on_is_expanded_changed,
7472 })),
7473 reference: None,
7474 element_state,
7475 window_title_bar: None,
7476 structure: ElementStructure::None,
7477 }
7478 }
7479 Self::ComboBox(value) => {
7480 let value = std::rc::Rc::unwrap_or_clone(value);
7481 let ComboBox {
7482 items_source,
7483 selected_index,
7484 placeholder_text,
7485 is_editable,
7486 is_enabled,
7487 on_selection_changed,
7488 reference,
7489 element_state,
7490 } = value;
7491 ElementParts {
7492 kind: MountedKind::ComboBox,
7493 props: MountedProps::ComboBox(std::rc::Rc::new(ComboBoxMountedProps {
7494 items_source,
7495 selected_index,
7496 placeholder_text,
7497 is_editable,
7498 is_enabled,
7499 on_selection_changed,
7500 })),
7501 reference,
7502 element_state,
7503 window_title_bar: None,
7504 structure: ElementStructure::None,
7505 }
7506 }
7507 Self::Pivot(value) => {
7508 let value = std::rc::Rc::unwrap_or_clone(value);
7509 let Pivot {
7510 selected_index,
7511 title,
7512 on_selection_changed,
7513 element_state,
7514 } = value;
7515 ElementParts {
7516 kind: MountedKind::Pivot,
7517 props: MountedProps::Pivot(std::rc::Rc::new(PivotMountedProps {
7518 selected_index,
7519 title,
7520 on_selection_changed,
7521 })),
7522 reference: None,
7523 element_state,
7524 window_title_bar: None,
7525 structure: ElementStructure::None,
7526 }
7527 }
7528 Self::PivotItem(value) => {
7529 let value = std::rc::Rc::unwrap_or_clone(value);
7530 let PivotItem {
7531 header,
7532 element_state,
7533 content,
7534 } = value;
7535 ElementParts {
7536 kind: MountedKind::PivotItem,
7537 props: MountedProps::PivotItem(std::rc::Rc::new(PivotItemMountedProps {
7538 header,
7539 })),
7540 reference: None,
7541 element_state,
7542 window_title_bar: None,
7543 structure: ElementStructure::Content(content.map(|element| *element)),
7544 }
7545 }
7546 Self::FlipView(value) => {
7547 let value = std::rc::Rc::unwrap_or_clone(value);
7548 let FlipView {
7549 selected_index,
7550 on_selection_changed,
7551 element_state,
7552 } = value;
7553 ElementParts {
7554 kind: MountedKind::FlipView,
7555 props: MountedProps::FlipView(std::rc::Rc::new(FlipViewMountedProps {
7556 selected_index,
7557 on_selection_changed,
7558 })),
7559 reference: None,
7560 element_state,
7561 window_title_bar: None,
7562 structure: ElementStructure::None,
7563 }
7564 }
7565 Self::SelectorBar(value) => {
7566 let value = std::rc::Rc::unwrap_or_clone(value);
7567 let SelectorBar {
7568 on_selected_text_changed,
7569 element_state,
7570 } = value;
7571 ElementParts {
7572 kind: MountedKind::SelectorBar,
7573 props: MountedProps::SelectorBar(std::rc::Rc::new(
7574 SelectorBarMountedProps {
7575 on_selected_text_changed,
7576 },
7577 )),
7578 reference: None,
7579 element_state,
7580 window_title_bar: None,
7581 structure: ElementStructure::None,
7582 }
7583 }
7584 Self::SelectorBarItem(value) => {
7585 let value = std::rc::Rc::unwrap_or_clone(value);
7586 let SelectorBarItem {
7587 text,
7588 is_selected,
7589 element_state,
7590 } = value;
7591 ElementParts {
7592 kind: MountedKind::SelectorBarItem,
7593 props: MountedProps::SelectorBarItem(std::rc::Rc::new(
7594 SelectorBarItemMountedProps { text, is_selected },
7595 )),
7596 reference: None,
7597 element_state,
7598 window_title_bar: None,
7599 structure: ElementStructure::None,
7600 }
7601 }
7602 Self::TabView(value) => {
7603 let value = std::rc::Rc::unwrap_or_clone(value);
7604 let TabView {
7605 selected_index,
7606 can_reorder_tabs,
7607 is_add_tab_button_visible,
7608 events,
7609 element_state,
7610 } = value;
7611 ElementParts {
7612 kind: MountedKind::TabView,
7613 props: MountedProps::TabView(std::rc::Rc::new(TabViewMountedProps {
7614 selected_index,
7615 can_reorder_tabs,
7616 is_add_tab_button_visible,
7617 events,
7618 })),
7619 reference: None,
7620 element_state,
7621 window_title_bar: None,
7622 structure: ElementStructure::None,
7623 }
7624 }
7625 Self::TabViewItem(value) => {
7626 let value = std::rc::Rc::unwrap_or_clone(value);
7627 let TabViewItem {
7628 header,
7629 is_closable,
7630 tag,
7631 element_state,
7632 content,
7633 } = value;
7634 ElementParts {
7635 kind: MountedKind::TabViewItem,
7636 props: MountedProps::TabViewItem(std::rc::Rc::new(
7637 TabViewItemMountedProps {
7638 header,
7639 is_closable,
7640 tag,
7641 },
7642 )),
7643 reference: None,
7644 element_state,
7645 window_title_bar: None,
7646 structure: ElementStructure::Content(content.map(|element| *element)),
7647 }
7648 }
7649 Self::TeachingTip(value) => {
7650 let value = std::rc::Rc::unwrap_or_clone(value);
7651 let TeachingTip {
7652 title,
7653 subtitle,
7654 is_open,
7655 is_light_dismiss_enabled,
7656 preferred_placement,
7657 action_button_content,
7658 close_button_content,
7659 events,
7660 element_state,
7661 } = value;
7662 ElementParts {
7663 kind: MountedKind::TeachingTip,
7664 props: MountedProps::TeachingTip(std::rc::Rc::new(
7665 TeachingTipMountedProps {
7666 title,
7667 subtitle,
7668 is_open,
7669 is_light_dismiss_enabled,
7670 preferred_placement,
7671 action_button_content,
7672 close_button_content,
7673 events,
7674 },
7675 )),
7676 reference: None,
7677 element_state,
7678 window_title_bar: None,
7679 structure: ElementStructure::None,
7680 }
7681 }
7682 Self::DropDownButton(value) => {
7683 let value = std::rc::Rc::unwrap_or_clone(value);
7684 let DropDownButton {
7685 is_enabled,
7686 on_click,
7687 element_state,
7688 content,
7689 } = value;
7690 ElementParts {
7691 kind: MountedKind::DropDownButton,
7692 props: MountedProps::DropDownButton(std::rc::Rc::new(
7693 DropDownButtonMountedProps {
7694 is_enabled,
7695 on_click,
7696 },
7697 )),
7698 reference: None,
7699 element_state,
7700 window_title_bar: None,
7701 structure: ElementStructure::Content(content.map(|element| *element)),
7702 }
7703 }
7704 Self::CommandBar(value) => {
7705 let value = std::rc::Rc::unwrap_or_clone(value);
7706 let CommandBar { element_state } = value;
7707 ElementParts {
7708 kind: MountedKind::CommandBar,
7709 props: MountedProps::CommandBar(std::rc::Rc::new(
7710 CommandBarMountedProps {},
7711 )),
7712 reference: None,
7713 element_state,
7714 window_title_bar: None,
7715 structure: ElementStructure::None,
7716 }
7717 }
7718 Self::AppBarButton(value) => {
7719 let value = std::rc::Rc::unwrap_or_clone(value);
7720 let AppBarButton {
7721 label,
7722 is_enabled,
7723 on_click,
7724 element_state,
7725 } = value;
7726 ElementParts {
7727 kind: MountedKind::AppBarButton,
7728 props: MountedProps::AppBarButton(std::rc::Rc::new(
7729 AppBarButtonMountedProps {
7730 label,
7731 is_enabled,
7732 on_click,
7733 },
7734 )),
7735 reference: None,
7736 element_state,
7737 window_title_bar: None,
7738 structure: ElementStructure::None,
7739 }
7740 }
7741 Self::AppBarSeparator(value) => {
7742 let value = std::rc::Rc::unwrap_or_clone(value);
7743 let AppBarSeparator { element_state } = value;
7744 ElementParts {
7745 kind: MountedKind::AppBarSeparator,
7746 props: MountedProps::AppBarSeparator(std::rc::Rc::new(
7747 AppBarSeparatorMountedProps {},
7748 )),
7749 reference: None,
7750 element_state,
7751 window_title_bar: None,
7752 structure: ElementStructure::None,
7753 }
7754 }
7755 Self::MenuBar(value) => {
7756 let value = std::rc::Rc::unwrap_or_clone(value);
7757 let MenuBar { element_state } = value;
7758 ElementParts {
7759 kind: MountedKind::MenuBar,
7760 props: MountedProps::MenuBar(std::rc::Rc::new(MenuBarMountedProps {})),
7761 reference: None,
7762 element_state,
7763 window_title_bar: None,
7764 structure: ElementStructure::None,
7765 }
7766 }
7767 Self::MenuBarItem(value) => {
7768 let value = std::rc::Rc::unwrap_or_clone(value);
7769 let MenuBarItem {
7770 title,
7771 element_state,
7772 } = value;
7773 ElementParts {
7774 kind: MountedKind::MenuBarItem,
7775 props: MountedProps::MenuBarItem(std::rc::Rc::new(
7776 MenuBarItemMountedProps { title },
7777 )),
7778 reference: None,
7779 element_state,
7780 window_title_bar: None,
7781 structure: ElementStructure::None,
7782 }
7783 }
7784 Self::SplitButton(value) => {
7785 let value = std::rc::Rc::unwrap_or_clone(value);
7786 let SplitButton {
7787 is_enabled,
7788 on_click,
7789 element_state,
7790 content,
7791 } = value;
7792 ElementParts {
7793 kind: MountedKind::SplitButton,
7794 props: MountedProps::SplitButton(std::rc::Rc::new(
7795 SplitButtonMountedProps {
7796 is_enabled,
7797 on_click,
7798 },
7799 )),
7800 reference: None,
7801 element_state,
7802 window_title_bar: None,
7803 structure: ElementStructure::Content(content.map(|element| *element)),
7804 }
7805 }
7806 Self::ColorPicker(value) => {
7807 let value = std::rc::Rc::unwrap_or_clone(value);
7808 let ColorPicker {
7809 color,
7810 is_alpha_enabled,
7811 is_hex_input_visible,
7812 is_color_slider_visible,
7813 is_color_channel_text_input_visible,
7814 is_enabled,
7815 on_color_changed,
7816 element_state,
7817 } = value;
7818 ElementParts {
7819 kind: MountedKind::ColorPicker,
7820 props: MountedProps::ColorPicker(std::rc::Rc::new(
7821 ColorPickerMountedProps {
7822 color,
7823 is_alpha_enabled,
7824 is_hex_input_visible,
7825 is_color_slider_visible,
7826 is_color_channel_text_input_visible,
7827 is_enabled,
7828 on_color_changed,
7829 },
7830 )),
7831 reference: None,
7832 element_state,
7833 window_title_bar: None,
7834 structure: ElementStructure::None,
7835 }
7836 }
7837 Self::DatePicker(value) => {
7838 let value = std::rc::Rc::unwrap_or_clone(value);
7839 let DatePicker {
7840 day_visible,
7841 month_visible,
7842 year_visible,
7843 is_enabled,
7844 on_selected_date_changed,
7845 element_state,
7846 } = value;
7847 ElementParts {
7848 kind: MountedKind::DatePicker,
7849 props: MountedProps::DatePicker(std::rc::Rc::new(DatePickerMountedProps {
7850 day_visible,
7851 month_visible,
7852 year_visible,
7853 is_enabled,
7854 on_selected_date_changed,
7855 })),
7856 reference: None,
7857 element_state,
7858 window_title_bar: None,
7859 structure: ElementStructure::None,
7860 }
7861 }
7862 Self::TimePicker(value) => {
7863 let value = std::rc::Rc::unwrap_or_clone(value);
7864 let TimePicker {
7865 clock_identifier,
7866 minute_increment,
7867 is_enabled,
7868 on_selected_time_changed,
7869 element_state,
7870 } = value;
7871 ElementParts {
7872 kind: MountedKind::TimePicker,
7873 props: MountedProps::TimePicker(std::rc::Rc::new(TimePickerMountedProps {
7874 clock_identifier,
7875 minute_increment,
7876 is_enabled,
7877 on_selected_time_changed,
7878 })),
7879 reference: None,
7880 element_state,
7881 window_title_bar: None,
7882 structure: ElementStructure::None,
7883 }
7884 }
7885 Self::CalendarDatePicker(value) => {
7886 let value = std::rc::Rc::unwrap_or_clone(value);
7887 let CalendarDatePicker {
7888 placeholder_text,
7889 is_today_highlighted,
7890 is_calendar_open,
7891 is_enabled,
7892 on_date_changed,
7893 element_state,
7894 } = value;
7895 ElementParts {
7896 kind: MountedKind::CalendarDatePicker,
7897 props: MountedProps::CalendarDatePicker(std::rc::Rc::new(
7898 CalendarDatePickerMountedProps {
7899 placeholder_text,
7900 is_today_highlighted,
7901 is_calendar_open,
7902 is_enabled,
7903 on_date_changed,
7904 },
7905 )),
7906 reference: None,
7907 element_state,
7908 window_title_bar: None,
7909 structure: ElementStructure::None,
7910 }
7911 }
7912 Self::ToolTip(value) => {
7913 let value = std::rc::Rc::unwrap_or_clone(value);
7914 let ToolTip { content } = value;
7915 ElementParts {
7916 kind: MountedKind::ToolTip,
7917 props: MountedProps::ToolTip(std::rc::Rc::new(ToolTipMountedProps {})),
7918 reference: None,
7919 element_state: None,
7920 window_title_bar: None,
7921 structure: ElementStructure::Content(content.map(|element| *element)),
7922 }
7923 }
7924 Self::ContentDialog(value) => {
7925 let value = std::rc::Rc::unwrap_or_clone(value);
7926 let ContentDialog {
7927 title,
7928 primary_button_text,
7929 secondary_button_text,
7930 close_button_text,
7931 is_primary_button_enabled,
7932 is_secondary_button_enabled,
7933 on_closed,
7934 content,
7935 is_open: _,
7936 } = value;
7937 ElementParts {
7938 kind: MountedKind::ContentDialog,
7939 props: MountedProps::ContentDialog(std::rc::Rc::new(
7940 ContentDialogMountedProps {
7941 title,
7942 primary_button_text,
7943 secondary_button_text,
7944 close_button_text,
7945 is_primary_button_enabled,
7946 is_secondary_button_enabled,
7947 on_closed,
7948 },
7949 )),
7950 reference: None,
7951 element_state: None,
7952 window_title_bar: None,
7953 structure: ElementStructure::Content(content.map(|element| *element)),
7954 }
7955 }
7956 Self::CalendarView(value) => {
7957 let value = std::rc::Rc::unwrap_or_clone(value);
7958 let CalendarView {
7959 is_today_highlighted,
7960 is_group_label_visible,
7961 is_enabled,
7962 on_selected_dates_changed,
7963 element_state,
7964 } = value;
7965 ElementParts {
7966 kind: MountedKind::CalendarView,
7967 props: MountedProps::CalendarView(std::rc::Rc::new(
7968 CalendarViewMountedProps {
7969 is_today_highlighted,
7970 is_group_label_visible,
7971 is_enabled,
7972 on_selected_dates_changed,
7973 },
7974 )),
7975 reference: None,
7976 element_state,
7977 window_title_bar: None,
7978 structure: ElementStructure::None,
7979 }
7980 }
7981 Self::ListView(value) => {
7982 let value = std::rc::Rc::unwrap_or_clone(value);
7983 let ListView {
7984 selected_index,
7985 selection_mode,
7986 can_drag_items,
7987 can_reorder_items,
7988 allow_drop,
7989 events,
7990 element_state,
7991 } = value;
7992 ElementParts {
7993 kind: MountedKind::ListView,
7994 props: MountedProps::ListView(std::rc::Rc::new(ListViewMountedProps {
7995 selected_index,
7996 selection_mode,
7997 can_drag_items,
7998 can_reorder_items,
7999 allow_drop,
8000 events,
8001 })),
8002 reference: None,
8003 element_state,
8004 window_title_bar: None,
8005 structure: ElementStructure::None,
8006 }
8007 }
8008 Self::ListViewItem(value) => {
8009 let value = std::rc::Rc::unwrap_or_clone(value);
8010 let ListViewItem {
8011 tag,
8012 element_state,
8013 content,
8014 } = value;
8015 ElementParts {
8016 kind: MountedKind::ListViewItem,
8017 props: MountedProps::ListViewItem(std::rc::Rc::new(
8018 ListViewItemMountedProps { tag },
8019 )),
8020 reference: None,
8021 element_state,
8022 window_title_bar: None,
8023 structure: ElementStructure::Content(content.map(|element| *element)),
8024 }
8025 }
8026 Self::TreeView(value) => {
8027 let value = std::rc::Rc::unwrap_or_clone(value);
8028 let TreeView {
8029 selection_mode,
8030 on_item_invoked,
8031 element_state,
8032 } = value;
8033 ElementParts {
8034 kind: MountedKind::TreeView,
8035 props: MountedProps::TreeView(std::rc::Rc::new(TreeViewMountedProps {
8036 selection_mode,
8037 on_item_invoked,
8038 })),
8039 reference: None,
8040 element_state,
8041 window_title_bar: None,
8042 structure: ElementStructure::None,
8043 }
8044 }
8045 Self::GridView(value) => {
8046 let value = std::rc::Rc::unwrap_or_clone(value);
8047 let GridView {
8048 selected_index,
8049 can_drag_items,
8050 can_reorder_items,
8051 allow_drop,
8052 events,
8053 element_state,
8054 } = value;
8055 ElementParts {
8056 kind: MountedKind::GridView,
8057 props: MountedProps::GridView(std::rc::Rc::new(GridViewMountedProps {
8058 selected_index,
8059 can_drag_items,
8060 can_reorder_items,
8061 allow_drop,
8062 events,
8063 })),
8064 reference: None,
8065 element_state,
8066 window_title_bar: None,
8067 structure: ElementStructure::None,
8068 }
8069 }
8070 Self::GridViewItem(value) => {
8071 let value = std::rc::Rc::unwrap_or_clone(value);
8072 let GridViewItem {
8073 tag,
8074 element_state,
8075 content,
8076 } = value;
8077 ElementParts {
8078 kind: MountedKind::GridViewItem,
8079 props: MountedProps::GridViewItem(std::rc::Rc::new(
8080 GridViewItemMountedProps { tag },
8081 )),
8082 reference: None,
8083 element_state,
8084 window_title_bar: None,
8085 structure: ElementStructure::Content(content.map(|element| *element)),
8086 }
8087 }
8088 Self::RelativePanel(value) => {
8089 let value = std::rc::Rc::unwrap_or_clone(value);
8090 let RelativePanel {
8091 element_state,
8092 children,
8093 } = value;
8094 ElementParts {
8095 kind: MountedKind::RelativePanel,
8096 props: MountedProps::RelativePanel(std::rc::Rc::new(
8097 RelativePanelMountedProps {},
8098 )),
8099 reference: None,
8100 element_state,
8101 window_title_bar: None,
8102 structure: ElementStructure::Children(children),
8103 }
8104 }
8105 Self::Canvas(value) => {
8106 let value = std::rc::Rc::unwrap_or_clone(value);
8107 let Canvas {
8108 element_state,
8109 children,
8110 } = value;
8111 ElementParts {
8112 kind: MountedKind::Canvas,
8113 props: MountedProps::Canvas(std::rc::Rc::new(CanvasMountedProps {})),
8114 reference: None,
8115 element_state,
8116 window_title_bar: None,
8117 structure: ElementStructure::Children(children),
8118 }
8119 }
8120 Self::RichEditBox(value) => {
8121 let value = std::rc::Rc::unwrap_or_clone(value);
8122 let RichEditBox {
8123 text,
8124 placeholder_text,
8125 is_read_only,
8126 is_enabled,
8127 on_text_changed,
8128 reference,
8129 element_state,
8130 } = value;
8131 ElementParts {
8132 kind: MountedKind::RichEditBox,
8133 props: MountedProps::RichEditBox(std::rc::Rc::new(
8134 RichEditBoxMountedProps {
8135 text,
8136 placeholder_text,
8137 is_read_only,
8138 is_enabled,
8139 on_text_changed,
8140 },
8141 )),
8142 reference,
8143 element_state,
8144 window_title_bar: None,
8145 structure: ElementStructure::None,
8146 }
8147 }
8148 Self::RichTextBlock(value) => {
8149 let value = std::rc::Rc::unwrap_or_clone(value);
8150 let RichTextBlock {
8151 paragraphs,
8152 font_size,
8153 is_text_selection_enabled,
8154 text_wrapping,
8155 element_state,
8156 } = value;
8157 ElementParts {
8158 kind: MountedKind::RichTextBlock,
8159 props: MountedProps::RichTextBlock(std::rc::Rc::new(
8160 RichTextBlockMountedProps {
8161 paragraphs,
8162 font_size,
8163 is_text_selection_enabled,
8164 text_wrapping,
8165 },
8166 )),
8167 reference: None,
8168 element_state,
8169 window_title_bar: None,
8170 structure: ElementStructure::None,
8171 }
8172 }
8173 Self::Viewbox(value) => {
8174 let value = std::rc::Rc::unwrap_or_clone(value);
8175 let Viewbox {
8176 stretch,
8177 element_state,
8178 } = value;
8179 ElementParts {
8180 kind: MountedKind::Viewbox,
8181 props: MountedProps::Viewbox(std::rc::Rc::new(ViewboxMountedProps {
8182 stretch,
8183 })),
8184 reference: None,
8185 element_state,
8186 window_title_bar: None,
8187 structure: ElementStructure::None,
8188 }
8189 }
8190 Self::WebView2(value) => {
8191 let value = std::rc::Rc::unwrap_or_clone(value);
8192 let WebView2 {
8193 reference,
8194 element_state,
8195 } = value;
8196 ElementParts {
8197 kind: MountedKind::WebView2,
8198 props: MountedProps::WebView2(std::rc::Rc::new(WebView2MountedProps {})),
8199 reference,
8200 element_state,
8201 window_title_bar: None,
8202 structure: ElementStructure::None,
8203 }
8204 }
8205 Self::SwapChainPanel(value) => {
8206 let value = std::rc::Rc::unwrap_or_clone(value);
8207 let SwapChainPanel {
8208 reference,
8209 element_state,
8210 } = value;
8211 ElementParts {
8212 kind: MountedKind::SwapChainPanel,
8213 props: MountedProps::SwapChainPanel(std::rc::Rc::new(
8214 SwapChainPanelMountedProps {},
8215 )),
8216 reference,
8217 element_state,
8218 window_title_bar: None,
8219 structure: ElementStructure::None,
8220 }
8221 }
8222 }
8223 }
8224 fn props_match(&self, props: &MountedProps) -> bool {
8225 match (self, props) {
8226 (Self::TextBlock(value), MountedProps::TextBlock(mounted)) => {
8227 true && value.text == mounted.text
8228 && value.text_wrapping == mounted.text_wrapping
8229 && f64_property_eq(&value.font_size, &mounted.font_size)
8230 && value.font_weight == mounted.font_weight
8231 && value.is_text_selection_enabled == mounted.is_text_selection_enabled
8232 && value.max_lines == mounted.max_lines
8233 && value.text_trimming == mounted.text_trimming
8234 && value.foreground == mounted.foreground
8235 }
8236 (Self::Button(value), MountedProps::Button(mounted)) => {
8237 true && value.is_enabled == mounted.is_enabled
8238 && value.horizontal_content_alignment
8239 == mounted.horizontal_content_alignment
8240 && value.vertical_content_alignment == mounted.vertical_content_alignment
8241 && value.resource_overrides == mounted.resource_overrides
8242 && value.style == mounted.style
8243 && value.key_accelerators == mounted.key_accelerators
8244 && value.on_click == mounted.on_click
8245 }
8246 (Self::HyperlinkButton(value), MountedProps::HyperlinkButton(mounted)) => {
8247 true && value.navigate_uri == mounted.navigate_uri
8248 && value.is_enabled == mounted.is_enabled
8249 && value.on_click == mounted.on_click
8250 }
8251 (Self::RepeatButton(value), MountedProps::RepeatButton(mounted)) => {
8252 true && value.delay == mounted.delay
8253 && value.interval == mounted.interval
8254 && value.is_enabled == mounted.is_enabled
8255 && value.on_click == mounted.on_click
8256 }
8257 (Self::Border(value), MountedProps::Border(mounted)) => {
8258 true && value.padding == mounted.padding
8259 && value.border_thickness == mounted.border_thickness
8260 && value.corner_radius == mounted.corner_radius
8261 && value.background == mounted.background
8262 && value.border_brush == mounted.border_brush
8263 && value.opacity_transition == mounted.opacity_transition
8264 && f64_property_eq(&value.scale, &mounted.scale)
8265 && value.scale_transition == mounted.scale_transition
8266 && value.capture_pointer_on_press == mounted.capture_pointer_on_press
8267 && value.drop_policy == mounted.drop_policy
8268 && value.events == mounted.events
8269 }
8270 (Self::BreadcrumbBar(value), MountedProps::BreadcrumbBar(mounted)) => {
8271 true && value.items_source == mounted.items_source
8272 && value.on_item_clicked == mounted.on_item_clicked
8273 }
8274 (Self::StackPanel(value), MountedProps::StackPanel(mounted)) => {
8275 true && value.orientation == mounted.orientation
8276 && f64_property_eq(&value.spacing, &mounted.spacing)
8277 }
8278 (
8279 Self::VariableSizedWrapGrid(value),
8280 MountedProps::VariableSizedWrapGrid(mounted),
8281 ) => {
8282 true && f64_property_eq(&value.item_width, &mounted.item_width)
8283 && f64_property_eq(&value.item_height, &mounted.item_height)
8284 && value.orientation == mounted.orientation
8285 }
8286 (Self::Grid(value), MountedProps::Grid(mounted)) => {
8287 true && f64_property_eq(&value.row_spacing, &mounted.row_spacing)
8288 && f64_property_eq(&value.column_spacing, &mounted.column_spacing)
8289 && value.key_accelerators == mounted.key_accelerators
8290 && value.background == mounted.background
8291 && value.rows == mounted.rows
8292 && value.columns == mounted.columns
8293 }
8294 (Self::TextBox(value), MountedProps::TextBox(mounted)) => {
8295 true && value.text == mounted.text
8296 && value.placeholder_text == mounted.placeholder_text
8297 && value.is_enabled == mounted.is_enabled
8298 && value.accepts_return == mounted.accepts_return
8299 && value.text_wrapping == mounted.text_wrapping
8300 && value.background == mounted.background
8301 && value.border_brush == mounted.border_brush
8302 && value.border_thickness == mounted.border_thickness
8303 && value.on_text_changed == mounted.on_text_changed
8304 }
8305 (Self::AutoSuggestBox(value), MountedProps::AutoSuggestBox(mounted)) => {
8306 true && value.text == mounted.text
8307 && value.items_source == mounted.items_source
8308 && value.placeholder_text == mounted.placeholder_text
8309 && value.is_enabled == mounted.is_enabled
8310 && value.events == mounted.events
8311 }
8312 (Self::PasswordBox(value), MountedProps::PasswordBox(mounted)) => {
8313 true && value.password == mounted.password
8314 && value.placeholder_text == mounted.placeholder_text
8315 && value.password_reveal_mode == mounted.password_reveal_mode
8316 && value.is_enabled == mounted.is_enabled
8317 && value.on_password_changed == mounted.on_password_changed
8318 }
8319 (Self::NumberBox(value), MountedProps::NumberBox(mounted)) => {
8320 true && f64_property_eq(&value.minimum, &mounted.minimum)
8321 && f64_property_eq(&value.maximum, &mounted.maximum)
8322 && value.value == mounted.value
8323 && value.is_enabled == mounted.is_enabled
8324 && value.on_value_changed == mounted.on_value_changed
8325 }
8326 (Self::Slider(value), MountedProps::Slider(mounted)) => {
8327 true && f64_property_eq(&value.minimum, &mounted.minimum)
8328 && f64_property_eq(&value.maximum, &mounted.maximum)
8329 && f64_property_eq(&value.value, &mounted.value)
8330 && value.is_enabled == mounted.is_enabled
8331 && f64_property_eq(&value.step_frequency, &mounted.step_frequency)
8332 && value.orientation == mounted.orientation
8333 && value.on_value_changed == mounted.on_value_changed
8334 }
8335 (Self::TitleBar(value), MountedProps::TitleBar(mounted)) => {
8336 true && value.title == mounted.title
8337 && value.subtitle == mounted.subtitle
8338 && value.is_back_button_visible == mounted.is_back_button_visible
8339 && value.is_back_button_enabled == mounted.is_back_button_enabled
8340 && value.is_pane_toggle_button_visible
8341 == mounted.is_pane_toggle_button_visible
8342 && value.events == mounted.events
8343 }
8344 (Self::NavigationView(value), MountedProps::NavigationView(mounted)) => {
8345 true && value.is_enabled == mounted.is_enabled
8346 && value.pane_display_mode == mounted.pane_display_mode
8347 && value.is_pane_toggle_button_visible
8348 == mounted.is_pane_toggle_button_visible
8349 && value.is_back_button_visible == mounted.is_back_button_visible
8350 && value.is_settings_visible == mounted.is_settings_visible
8351 && value.always_show_header == mounted.always_show_header
8352 && value.pane_title == mounted.pane_title
8353 && f64_property_eq(&value.open_pane_length, &mounted.open_pane_length)
8354 && value.is_pane_open == mounted.is_pane_open
8355 && value.events == mounted.events
8356 }
8357 (Self::NavigationViewItem(value), MountedProps::NavigationViewItem(mounted)) => {
8358 true && value.tag == mounted.tag
8359 && value.is_selected == mounted.is_selected
8360 && value.selects_on_invoked == mounted.selects_on_invoked
8361 && value.is_expanded == mounted.is_expanded
8362 }
8363 (Self::SplitView(value), MountedProps::SplitView(mounted)) => {
8364 true && f64_property_eq(&value.open_pane_length, &mounted.open_pane_length)
8365 && f64_property_eq(&value.compact_pane_length, &mounted.compact_pane_length)
8366 && value.display_mode == mounted.display_mode
8367 && value.is_pane_open == mounted.is_pane_open
8368 && value.on_pane_closed == mounted.on_pane_closed
8369 }
8370 (Self::ProgressBar(value), MountedProps::ProgressBar(mounted)) => {
8371 true && f64_property_eq(&value.minimum, &mounted.minimum)
8372 && f64_property_eq(&value.maximum, &mounted.maximum)
8373 && f64_property_eq(&value.value, &mounted.value)
8374 && value.is_indeterminate == mounted.is_indeterminate
8375 && value.show_error == mounted.show_error
8376 && value.show_paused == mounted.show_paused
8377 && value.is_enabled == mounted.is_enabled
8378 }
8379 (Self::ToggleSwitch(value), MountedProps::ToggleSwitch(mounted)) => {
8380 true && value.is_on == mounted.is_on
8381 && value.is_enabled == mounted.is_enabled
8382 && value.on_toggled == mounted.on_toggled
8383 }
8384 (Self::CheckBox(value), MountedProps::CheckBox(mounted)) => {
8385 true && value.is_checked == mounted.is_checked
8386 && value.is_enabled == mounted.is_enabled
8387 && value.on_is_checked_changed == mounted.on_is_checked_changed
8388 }
8389 (Self::ToggleButton(value), MountedProps::ToggleButton(mounted)) => {
8390 true && value.is_checked == mounted.is_checked
8391 && value.is_enabled == mounted.is_enabled
8392 && value.on_is_checked_changed == mounted.on_is_checked_changed
8393 }
8394 (Self::RadioButton(value), MountedProps::RadioButton(mounted)) => {
8395 true && value.group_name == mounted.group_name
8396 && value.is_checked == mounted.is_checked
8397 && value.is_enabled == mounted.is_enabled
8398 && value.on_checked == mounted.on_checked
8399 }
8400 (Self::RadioButtons(value), MountedProps::RadioButtons(mounted)) => {
8401 true && value.items_source == mounted.items_source
8402 && value.selected_index == mounted.selected_index
8403 && value.max_columns == mounted.max_columns
8404 && value.on_selection_changed == mounted.on_selection_changed
8405 }
8406 (Self::ItemsRepeater(_), MountedProps::ItemsRepeater(_)) => true,
8407 (Self::InfoBadge(value), MountedProps::InfoBadge(mounted)) => {
8408 true && value.value == mounted.value
8409 }
8410 (Self::InfoBar(value), MountedProps::InfoBar(mounted)) => {
8411 true && value.title == mounted.title
8412 && value.message == mounted.message
8413 && value.severity == mounted.severity
8414 && value.is_open == mounted.is_open
8415 && value.is_closable == mounted.is_closable
8416 && value.on_closed == mounted.on_closed
8417 }
8418 (Self::PersonPicture(value), MountedProps::PersonPicture(mounted)) => {
8419 true && value.display_name == mounted.display_name
8420 && value.initials == mounted.initials
8421 }
8422 (Self::ScrollViewer(value), MountedProps::ScrollViewer(mounted)) => {
8423 true && value.horizontal_scroll_bar_visibility
8424 == mounted.horizontal_scroll_bar_visibility
8425 && value.vertical_scroll_bar_visibility
8426 == mounted.vertical_scroll_bar_visibility
8427 }
8428 (Self::ScrollView(value), MountedProps::ScrollView(mounted)) => {
8429 true && value.horizontal_scroll_bar_visibility
8430 == mounted.horizontal_scroll_bar_visibility
8431 && value.vertical_scroll_bar_visibility
8432 == mounted.vertical_scroll_bar_visibility
8433 }
8434 (Self::Image(value), MountedProps::Image(mounted)) => {
8435 true && value.source == mounted.source
8436 && value.stretch == mounted.stretch
8437 && value.events == mounted.events
8438 }
8439 (Self::ProgressRing(value), MountedProps::ProgressRing(mounted)) => {
8440 true && f64_property_eq(&value.minimum, &mounted.minimum)
8441 && f64_property_eq(&value.maximum, &mounted.maximum)
8442 && f64_property_eq(&value.value, &mounted.value)
8443 && value.is_indeterminate == mounted.is_indeterminate
8444 && value.is_active == mounted.is_active
8445 && value.is_enabled == mounted.is_enabled
8446 }
8447 (Self::ListBox(value), MountedProps::ListBox(mounted)) => {
8448 true && value.is_enabled == mounted.is_enabled
8449 && value.on_selected_tag_changed == mounted.on_selected_tag_changed
8450 }
8451 (Self::Rectangle(value), MountedProps::Rectangle(mounted)) => {
8452 true && value.fill == mounted.fill
8453 && value.stroke == mounted.stroke
8454 && f64_property_eq(&value.stroke_thickness, &mounted.stroke_thickness)
8455 && f64_property_eq(&value.radius_x, &mounted.radius_x)
8456 && f64_property_eq(&value.radius_y, &mounted.radius_y)
8457 }
8458 (Self::Ellipse(value), MountedProps::Ellipse(mounted)) => {
8459 true && value.fill == mounted.fill
8460 && value.stroke == mounted.stroke
8461 && f64_property_eq(&value.stroke_thickness, &mounted.stroke_thickness)
8462 }
8463 (Self::Line(value), MountedProps::Line(mounted)) => {
8464 true && value.stroke == mounted.stroke
8465 && f64_property_eq(&value.stroke_thickness, &mounted.stroke_thickness)
8466 && f64_property_eq(&value.x1, &mounted.x1)
8467 && f64_property_eq(&value.y1, &mounted.y1)
8468 && f64_property_eq(&value.x2, &mounted.x2)
8469 && f64_property_eq(&value.y2, &mounted.y2)
8470 }
8471 (Self::SymbolIcon(value), MountedProps::SymbolIcon(mounted)) => {
8472 true && value.symbol == mounted.symbol
8473 }
8474 (Self::ImageIcon(value), MountedProps::ImageIcon(mounted)) => {
8475 true && value.source == mounted.source
8476 }
8477 (Self::FontIcon(value), MountedProps::FontIcon(mounted)) => {
8478 true && value.glyph == mounted.glyph
8479 }
8480 (Self::BitmapIcon(value), MountedProps::BitmapIcon(mounted)) => {
8481 true && value.uri_source == mounted.uri_source
8482 && value.show_as_monochrome == mounted.show_as_monochrome
8483 }
8484 (Self::PathIcon(value), MountedProps::PathIcon(mounted)) => {
8485 true && value.data == mounted.data
8486 }
8487 (Self::ListBoxItem(value), MountedProps::ListBoxItem(mounted)) => {
8488 true && value.tag == mounted.tag && value.is_selected == mounted.is_selected
8489 }
8490 (Self::RatingControl(value), MountedProps::RatingControl(mounted)) => {
8491 true && value.max_rating == mounted.max_rating
8492 && value.value == mounted.value
8493 && value.caption == mounted.caption
8494 && value.is_read_only == mounted.is_read_only
8495 && value.on_value_changed == mounted.on_value_changed
8496 }
8497 (Self::Expander(value), MountedProps::Expander(mounted)) => {
8498 true && value.is_expanded == mounted.is_expanded
8499 && value.on_is_expanded_changed == mounted.on_is_expanded_changed
8500 }
8501 (Self::ComboBox(value), MountedProps::ComboBox(mounted)) => {
8502 true && value.items_source == mounted.items_source
8503 && value.selected_index == mounted.selected_index
8504 && value.placeholder_text == mounted.placeholder_text
8505 && value.is_editable == mounted.is_editable
8506 && value.is_enabled == mounted.is_enabled
8507 && value.on_selection_changed == mounted.on_selection_changed
8508 }
8509 (Self::Pivot(value), MountedProps::Pivot(mounted)) => {
8510 true && value.selected_index == mounted.selected_index
8511 && value.title == mounted.title
8512 && value.on_selection_changed == mounted.on_selection_changed
8513 }
8514 (Self::PivotItem(value), MountedProps::PivotItem(mounted)) => {
8515 true && value.header == mounted.header
8516 }
8517 (Self::FlipView(value), MountedProps::FlipView(mounted)) => {
8518 true && value.selected_index == mounted.selected_index
8519 && value.on_selection_changed == mounted.on_selection_changed
8520 }
8521 (Self::SelectorBar(value), MountedProps::SelectorBar(mounted)) => {
8522 true && value.on_selected_text_changed == mounted.on_selected_text_changed
8523 }
8524 (Self::SelectorBarItem(value), MountedProps::SelectorBarItem(mounted)) => {
8525 true && value.text == mounted.text && value.is_selected == mounted.is_selected
8526 }
8527 (Self::TabView(value), MountedProps::TabView(mounted)) => {
8528 true && value.selected_index == mounted.selected_index
8529 && value.can_reorder_tabs == mounted.can_reorder_tabs
8530 && value.is_add_tab_button_visible == mounted.is_add_tab_button_visible
8531 && value.events == mounted.events
8532 }
8533 (Self::TabViewItem(value), MountedProps::TabViewItem(mounted)) => {
8534 true && value.header == mounted.header
8535 && value.is_closable == mounted.is_closable
8536 && value.tag == mounted.tag
8537 }
8538 (Self::TeachingTip(value), MountedProps::TeachingTip(mounted)) => {
8539 true && value.title == mounted.title
8540 && value.subtitle == mounted.subtitle
8541 && value.is_open == mounted.is_open
8542 && value.is_light_dismiss_enabled == mounted.is_light_dismiss_enabled
8543 && value.preferred_placement == mounted.preferred_placement
8544 && value.action_button_content == mounted.action_button_content
8545 && value.close_button_content == mounted.close_button_content
8546 && value.events == mounted.events
8547 }
8548 (Self::DropDownButton(value), MountedProps::DropDownButton(mounted)) => {
8549 true && value.is_enabled == mounted.is_enabled
8550 && value.on_click == mounted.on_click
8551 }
8552 (Self::CommandBar(_), MountedProps::CommandBar(_)) => true,
8553 (Self::AppBarButton(value), MountedProps::AppBarButton(mounted)) => {
8554 true && value.label == mounted.label
8555 && value.is_enabled == mounted.is_enabled
8556 && value.on_click == mounted.on_click
8557 }
8558 (Self::AppBarSeparator(_), MountedProps::AppBarSeparator(_)) => true,
8559 (Self::MenuBar(_), MountedProps::MenuBar(_)) => true,
8560 (Self::MenuBarItem(value), MountedProps::MenuBarItem(mounted)) => {
8561 true && value.title == mounted.title
8562 }
8563 (Self::SplitButton(value), MountedProps::SplitButton(mounted)) => {
8564 true && value.is_enabled == mounted.is_enabled
8565 && value.on_click == mounted.on_click
8566 }
8567 (Self::ColorPicker(value), MountedProps::ColorPicker(mounted)) => {
8568 true && value.color == mounted.color
8569 && value.is_alpha_enabled == mounted.is_alpha_enabled
8570 && value.is_hex_input_visible == mounted.is_hex_input_visible
8571 && value.is_color_slider_visible == mounted.is_color_slider_visible
8572 && value.is_color_channel_text_input_visible
8573 == mounted.is_color_channel_text_input_visible
8574 && value.is_enabled == mounted.is_enabled
8575 && value.on_color_changed == mounted.on_color_changed
8576 }
8577 (Self::DatePicker(value), MountedProps::DatePicker(mounted)) => {
8578 true && value.day_visible == mounted.day_visible
8579 && value.month_visible == mounted.month_visible
8580 && value.year_visible == mounted.year_visible
8581 && value.is_enabled == mounted.is_enabled
8582 && value.on_selected_date_changed == mounted.on_selected_date_changed
8583 }
8584 (Self::TimePicker(value), MountedProps::TimePicker(mounted)) => {
8585 true && value.clock_identifier == mounted.clock_identifier
8586 && value.minute_increment == mounted.minute_increment
8587 && value.is_enabled == mounted.is_enabled
8588 && value.on_selected_time_changed == mounted.on_selected_time_changed
8589 }
8590 (Self::CalendarDatePicker(value), MountedProps::CalendarDatePicker(mounted)) => {
8591 true && value.placeholder_text == mounted.placeholder_text
8592 && value.is_today_highlighted == mounted.is_today_highlighted
8593 && value.is_calendar_open == mounted.is_calendar_open
8594 && value.is_enabled == mounted.is_enabled
8595 && value.on_date_changed == mounted.on_date_changed
8596 }
8597 (Self::ToolTip(_), MountedProps::ToolTip(_)) => true,
8598 (Self::ContentDialog(value), MountedProps::ContentDialog(mounted)) => {
8599 true && value.title == mounted.title
8600 && value.primary_button_text == mounted.primary_button_text
8601 && value.secondary_button_text == mounted.secondary_button_text
8602 && value.close_button_text == mounted.close_button_text
8603 && value.is_primary_button_enabled == mounted.is_primary_button_enabled
8604 && value.is_secondary_button_enabled == mounted.is_secondary_button_enabled
8605 && value.on_closed == mounted.on_closed
8606 }
8607 (Self::CalendarView(value), MountedProps::CalendarView(mounted)) => {
8608 true && value.is_today_highlighted == mounted.is_today_highlighted
8609 && value.is_group_label_visible == mounted.is_group_label_visible
8610 && value.is_enabled == mounted.is_enabled
8611 && value.on_selected_dates_changed == mounted.on_selected_dates_changed
8612 }
8613 (Self::ListView(value), MountedProps::ListView(mounted)) => {
8614 true && value.selected_index == mounted.selected_index
8615 && value.selection_mode == mounted.selection_mode
8616 && value.can_drag_items == mounted.can_drag_items
8617 && value.can_reorder_items == mounted.can_reorder_items
8618 && value.allow_drop == mounted.allow_drop
8619 && value.events == mounted.events
8620 }
8621 (Self::ListViewItem(value), MountedProps::ListViewItem(mounted)) => {
8622 true && value.tag == mounted.tag
8623 }
8624 (Self::TreeView(value), MountedProps::TreeView(mounted)) => {
8625 true && value.selection_mode == mounted.selection_mode
8626 && value.on_item_invoked == mounted.on_item_invoked
8627 }
8628 (Self::GridView(value), MountedProps::GridView(mounted)) => {
8629 true && value.selected_index == mounted.selected_index
8630 && value.can_drag_items == mounted.can_drag_items
8631 && value.can_reorder_items == mounted.can_reorder_items
8632 && value.allow_drop == mounted.allow_drop
8633 && value.events == mounted.events
8634 }
8635 (Self::GridViewItem(value), MountedProps::GridViewItem(mounted)) => {
8636 true && value.tag == mounted.tag
8637 }
8638 (Self::RelativePanel(_), MountedProps::RelativePanel(_)) => true,
8639 (Self::Canvas(_), MountedProps::Canvas(_)) => true,
8640 (Self::RichEditBox(value), MountedProps::RichEditBox(mounted)) => {
8641 true && value.text == mounted.text
8642 && value.placeholder_text == mounted.placeholder_text
8643 && value.is_read_only == mounted.is_read_only
8644 && value.is_enabled == mounted.is_enabled
8645 && value.on_text_changed == mounted.on_text_changed
8646 }
8647 (Self::RichTextBlock(value), MountedProps::RichTextBlock(mounted)) => {
8648 true && value.paragraphs == mounted.paragraphs
8649 && f64_property_eq(&value.font_size, &mounted.font_size)
8650 && value.is_text_selection_enabled == mounted.is_text_selection_enabled
8651 && value.text_wrapping == mounted.text_wrapping
8652 }
8653 (Self::Viewbox(value), MountedProps::Viewbox(mounted)) => {
8654 true && value.stretch == mounted.stretch
8655 }
8656 (Self::WebView2(_), MountedProps::WebView2(_)) => true,
8657 (Self::SwapChainPanel(_), MountedProps::SwapChainPanel(_)) => true,
8658 _ => false,
8659 }
8660 }
8661 fn reference(&self) -> Option<&NativeElementRef> {
8662 match self {
8663 Self::TextBlock(_) => None,
8664 Self::Button(value) => value.reference.as_ref(),
8665 Self::HyperlinkButton(value) => value.reference.as_ref(),
8666 Self::RepeatButton(_) => None,
8667 Self::Border(_) => None,
8668 Self::BreadcrumbBar(_) => None,
8669 Self::StackPanel(_) => None,
8670 Self::VariableSizedWrapGrid(_) => None,
8671 Self::Grid(value) => value.reference.as_ref(),
8672 Self::TextBox(value) => value.reference.as_ref(),
8673 Self::AutoSuggestBox(value) => value.reference.as_ref(),
8674 Self::PasswordBox(value) => value.reference.as_ref(),
8675 Self::NumberBox(value) => value.reference.as_ref(),
8676 Self::Slider(value) => value.reference.as_ref(),
8677 Self::TitleBar(_) => None,
8678 Self::NavigationView(_) => None,
8679 Self::NavigationViewItem(_) => None,
8680 Self::SplitView(_) => None,
8681 Self::ProgressBar(_) => None,
8682 Self::ToggleSwitch(value) => value.reference.as_ref(),
8683 Self::CheckBox(value) => value.reference.as_ref(),
8684 Self::ToggleButton(value) => value.reference.as_ref(),
8685 Self::RadioButton(value) => value.reference.as_ref(),
8686 Self::RadioButtons(_) => None,
8687 Self::ItemsRepeater(_) => None,
8688 Self::InfoBadge(_) => None,
8689 Self::InfoBar(_) => None,
8690 Self::PersonPicture(_) => None,
8691 Self::ScrollViewer(_) => None,
8692 Self::ScrollView(_) => None,
8693 Self::Image(value) => value.reference.as_ref(),
8694 Self::ProgressRing(_) => None,
8695 Self::ListBox(_) => None,
8696 Self::Rectangle(_) => None,
8697 Self::Ellipse(_) => None,
8698 Self::Line(_) => None,
8699 Self::SymbolIcon(_) => None,
8700 Self::ImageIcon(_) => None,
8701 Self::FontIcon(_) => None,
8702 Self::BitmapIcon(_) => None,
8703 Self::PathIcon(_) => None,
8704 Self::ListBoxItem(_) => None,
8705 Self::RatingControl(value) => value.reference.as_ref(),
8706 Self::Expander(_) => None,
8707 Self::ComboBox(value) => value.reference.as_ref(),
8708 Self::Pivot(_) => None,
8709 Self::PivotItem(_) => None,
8710 Self::FlipView(_) => None,
8711 Self::SelectorBar(_) => None,
8712 Self::SelectorBarItem(_) => None,
8713 Self::TabView(_) => None,
8714 Self::TabViewItem(_) => None,
8715 Self::TeachingTip(_) => None,
8716 Self::DropDownButton(_) => None,
8717 Self::CommandBar(_) => None,
8718 Self::AppBarButton(_) => None,
8719 Self::AppBarSeparator(_) => None,
8720 Self::MenuBar(_) => None,
8721 Self::MenuBarItem(_) => None,
8722 Self::SplitButton(_) => None,
8723 Self::ColorPicker(_) => None,
8724 Self::DatePicker(_) => None,
8725 Self::TimePicker(_) => None,
8726 Self::CalendarDatePicker(_) => None,
8727 Self::ToolTip(_) => None,
8728 Self::ContentDialog(_) => None,
8729 Self::CalendarView(_) => None,
8730 Self::ListView(_) => None,
8731 Self::ListViewItem(_) => None,
8732 Self::TreeView(_) => None,
8733 Self::GridView(_) => None,
8734 Self::GridViewItem(_) => None,
8735 Self::RelativePanel(_) => None,
8736 Self::Canvas(_) => None,
8737 Self::RichEditBox(value) => value.reference.as_ref(),
8738 Self::RichTextBlock(_) => None,
8739 Self::Viewbox(_) => None,
8740 Self::WebView2(value) => value.reference.as_ref(),
8741 Self::SwapChainPanel(value) => value.reference.as_ref(),
8742 }
8743 }
8744 fn element_state(&self) -> Option<&ElementState> {
8745 match self {
8746 Self::TextBlock(value) => value.element_state.as_deref(),
8747 Self::Button(value) => value.element_state.as_deref(),
8748 Self::HyperlinkButton(value) => value.element_state.as_deref(),
8749 Self::RepeatButton(value) => value.element_state.as_deref(),
8750 Self::Border(value) => value.element_state.as_deref(),
8751 Self::BreadcrumbBar(value) => value.element_state.as_deref(),
8752 Self::StackPanel(value) => value.element_state.as_deref(),
8753 Self::VariableSizedWrapGrid(value) => value.element_state.as_deref(),
8754 Self::Grid(value) => value.element_state.as_deref(),
8755 Self::TextBox(value) => value.element_state.as_deref(),
8756 Self::AutoSuggestBox(value) => value.element_state.as_deref(),
8757 Self::PasswordBox(value) => value.element_state.as_deref(),
8758 Self::NumberBox(value) => value.element_state.as_deref(),
8759 Self::Slider(value) => value.element_state.as_deref(),
8760 Self::TitleBar(value) => value.element_state.as_deref(),
8761 Self::NavigationView(value) => value.element_state.as_deref(),
8762 Self::NavigationViewItem(value) => value.element_state.as_deref(),
8763 Self::SplitView(value) => value.element_state.as_deref(),
8764 Self::ProgressBar(value) => value.element_state.as_deref(),
8765 Self::ToggleSwitch(value) => value.element_state.as_deref(),
8766 Self::CheckBox(value) => value.element_state.as_deref(),
8767 Self::ToggleButton(value) => value.element_state.as_deref(),
8768 Self::RadioButton(value) => value.element_state.as_deref(),
8769 Self::RadioButtons(value) => value.element_state.as_deref(),
8770 Self::ItemsRepeater(value) => value.element_state.as_deref(),
8771 Self::InfoBadge(value) => value.element_state.as_deref(),
8772 Self::InfoBar(value) => value.element_state.as_deref(),
8773 Self::PersonPicture(value) => value.element_state.as_deref(),
8774 Self::ScrollViewer(value) => value.element_state.as_deref(),
8775 Self::ScrollView(value) => value.element_state.as_deref(),
8776 Self::Image(value) => value.element_state.as_deref(),
8777 Self::ProgressRing(value) => value.element_state.as_deref(),
8778 Self::ListBox(value) => value.element_state.as_deref(),
8779 Self::Rectangle(value) => value.element_state.as_deref(),
8780 Self::Ellipse(value) => value.element_state.as_deref(),
8781 Self::Line(value) => value.element_state.as_deref(),
8782 Self::SymbolIcon(value) => value.element_state.as_deref(),
8783 Self::ImageIcon(value) => value.element_state.as_deref(),
8784 Self::FontIcon(value) => value.element_state.as_deref(),
8785 Self::BitmapIcon(value) => value.element_state.as_deref(),
8786 Self::PathIcon(value) => value.element_state.as_deref(),
8787 Self::ListBoxItem(value) => value.element_state.as_deref(),
8788 Self::RatingControl(value) => value.element_state.as_deref(),
8789 Self::Expander(value) => value.element_state.as_deref(),
8790 Self::ComboBox(value) => value.element_state.as_deref(),
8791 Self::Pivot(value) => value.element_state.as_deref(),
8792 Self::PivotItem(value) => value.element_state.as_deref(),
8793 Self::FlipView(value) => value.element_state.as_deref(),
8794 Self::SelectorBar(value) => value.element_state.as_deref(),
8795 Self::SelectorBarItem(value) => value.element_state.as_deref(),
8796 Self::TabView(value) => value.element_state.as_deref(),
8797 Self::TabViewItem(value) => value.element_state.as_deref(),
8798 Self::TeachingTip(value) => value.element_state.as_deref(),
8799 Self::DropDownButton(value) => value.element_state.as_deref(),
8800 Self::CommandBar(value) => value.element_state.as_deref(),
8801 Self::AppBarButton(value) => value.element_state.as_deref(),
8802 Self::AppBarSeparator(value) => value.element_state.as_deref(),
8803 Self::MenuBar(value) => value.element_state.as_deref(),
8804 Self::MenuBarItem(value) => value.element_state.as_deref(),
8805 Self::SplitButton(value) => value.element_state.as_deref(),
8806 Self::ColorPicker(value) => value.element_state.as_deref(),
8807 Self::DatePicker(value) => value.element_state.as_deref(),
8808 Self::TimePicker(value) => value.element_state.as_deref(),
8809 Self::CalendarDatePicker(value) => value.element_state.as_deref(),
8810 Self::ToolTip(_) => None,
8811 Self::ContentDialog(_) => None,
8812 Self::CalendarView(value) => value.element_state.as_deref(),
8813 Self::ListView(value) => value.element_state.as_deref(),
8814 Self::ListViewItem(value) => value.element_state.as_deref(),
8815 Self::TreeView(value) => value.element_state.as_deref(),
8816 Self::GridView(value) => value.element_state.as_deref(),
8817 Self::GridViewItem(value) => value.element_state.as_deref(),
8818 Self::RelativePanel(value) => value.element_state.as_deref(),
8819 Self::Canvas(value) => value.element_state.as_deref(),
8820 Self::RichEditBox(value) => value.element_state.as_deref(),
8821 Self::RichTextBlock(value) => value.element_state.as_deref(),
8822 Self::Viewbox(value) => value.element_state.as_deref(),
8823 Self::WebView2(value) => value.element_state.as_deref(),
8824 Self::SwapChainPanel(value) => value.element_state.as_deref(),
8825 }
8826 }
8827 fn window_title_bar(&self) -> Option<WindowTitleBarHeight> {
8828 match self {
8829 Self::TextBlock(_) => None,
8830 Self::Button(_) => None,
8831 Self::HyperlinkButton(_) => None,
8832 Self::RepeatButton(_) => None,
8833 Self::Border(_) => None,
8834 Self::BreadcrumbBar(_) => None,
8835 Self::StackPanel(_) => None,
8836 Self::VariableSizedWrapGrid(_) => None,
8837 Self::Grid(_) => None,
8838 Self::TextBox(_) => None,
8839 Self::AutoSuggestBox(_) => None,
8840 Self::PasswordBox(_) => None,
8841 Self::NumberBox(_) => None,
8842 Self::Slider(_) => None,
8843 Self::TitleBar(value) => Some(value.preferred_height),
8844 Self::NavigationView(_) => None,
8845 Self::NavigationViewItem(_) => None,
8846 Self::SplitView(_) => None,
8847 Self::ProgressBar(_) => None,
8848 Self::ToggleSwitch(_) => None,
8849 Self::CheckBox(_) => None,
8850 Self::ToggleButton(_) => None,
8851 Self::RadioButton(_) => None,
8852 Self::RadioButtons(_) => None,
8853 Self::ItemsRepeater(_) => None,
8854 Self::InfoBadge(_) => None,
8855 Self::InfoBar(_) => None,
8856 Self::PersonPicture(_) => None,
8857 Self::ScrollViewer(_) => None,
8858 Self::ScrollView(_) => None,
8859 Self::Image(_) => None,
8860 Self::ProgressRing(_) => None,
8861 Self::ListBox(_) => None,
8862 Self::Rectangle(_) => None,
8863 Self::Ellipse(_) => None,
8864 Self::Line(_) => None,
8865 Self::SymbolIcon(_) => None,
8866 Self::ImageIcon(_) => None,
8867 Self::FontIcon(_) => None,
8868 Self::BitmapIcon(_) => None,
8869 Self::PathIcon(_) => None,
8870 Self::ListBoxItem(_) => None,
8871 Self::RatingControl(_) => None,
8872 Self::Expander(_) => None,
8873 Self::ComboBox(_) => None,
8874 Self::Pivot(_) => None,
8875 Self::PivotItem(_) => None,
8876 Self::FlipView(_) => None,
8877 Self::SelectorBar(_) => None,
8878 Self::SelectorBarItem(_) => None,
8879 Self::TabView(_) => None,
8880 Self::TabViewItem(_) => None,
8881 Self::TeachingTip(_) => None,
8882 Self::DropDownButton(_) => None,
8883 Self::CommandBar(_) => None,
8884 Self::AppBarButton(_) => None,
8885 Self::AppBarSeparator(_) => None,
8886 Self::MenuBar(_) => None,
8887 Self::MenuBarItem(_) => None,
8888 Self::SplitButton(_) => None,
8889 Self::ColorPicker(_) => None,
8890 Self::DatePicker(_) => None,
8891 Self::TimePicker(_) => None,
8892 Self::CalendarDatePicker(_) => None,
8893 Self::ToolTip(_) => None,
8894 Self::ContentDialog(_) => None,
8895 Self::CalendarView(_) => None,
8896 Self::ListView(_) => None,
8897 Self::ListViewItem(_) => None,
8898 Self::TreeView(_) => None,
8899 Self::GridView(_) => None,
8900 Self::GridViewItem(_) => None,
8901 Self::RelativePanel(_) => None,
8902 Self::Canvas(_) => None,
8903 Self::RichEditBox(_) => None,
8904 Self::RichTextBlock(_) => None,
8905 Self::Viewbox(_) => None,
8906 Self::WebView2(_) => None,
8907 Self::SwapChainPanel(_) => None,
8908 }
8909 }
8910 fn structure(&self) -> ElementStructureRef<'_> {
8911 match self {
8912 Self::TextBlock(_) => ElementStructureRef::None,
8913 Self::Button(value) => ElementStructureRef::Content(value.content.as_deref()),
8914 Self::HyperlinkButton(value) => {
8915 ElementStructureRef::Content(value.content.as_deref())
8916 }
8917 Self::RepeatButton(value) => ElementStructureRef::Content(value.content.as_deref()),
8918 Self::Border(value) => ElementStructureRef::Content(value.content.as_deref()),
8919 Self::BreadcrumbBar(_) => ElementStructureRef::None,
8920 Self::StackPanel(value) => ElementStructureRef::Children(value.children.as_slice()),
8921 Self::VariableSizedWrapGrid(value) => {
8922 ElementStructureRef::Children(value.children.as_slice())
8923 }
8924 Self::Grid(value) => ElementStructureRef::Children(value.children.as_slice()),
8925 Self::TextBox(_) => ElementStructureRef::None,
8926 Self::AutoSuggestBox(_) => ElementStructureRef::None,
8927 Self::PasswordBox(_) => ElementStructureRef::None,
8928 Self::NumberBox(_) => ElementStructureRef::None,
8929 Self::Slider(_) => ElementStructureRef::None,
8930 Self::TitleBar(_) => ElementStructureRef::None,
8931 Self::NavigationView(_) => ElementStructureRef::None,
8932 Self::NavigationViewItem(_) => ElementStructureRef::None,
8933 Self::SplitView(_) => ElementStructureRef::None,
8934 Self::ProgressBar(_) => ElementStructureRef::None,
8935 Self::ToggleSwitch(_) => ElementStructureRef::None,
8936 Self::CheckBox(value) => ElementStructureRef::Content(value.content.as_deref()),
8937 Self::ToggleButton(value) => ElementStructureRef::Content(value.content.as_deref()),
8938 Self::RadioButton(value) => ElementStructureRef::Content(value.content.as_deref()),
8939 Self::RadioButtons(_) => ElementStructureRef::None,
8940 Self::ItemsRepeater(value) => ElementStructureRef::Virtual(&value.items),
8941 Self::InfoBadge(_) => ElementStructureRef::None,
8942 Self::InfoBar(_) => ElementStructureRef::None,
8943 Self::PersonPicture(_) => ElementStructureRef::None,
8944 Self::ScrollViewer(value) => ElementStructureRef::Content(value.content.as_deref()),
8945 Self::ScrollView(value) => ElementStructureRef::Content(value.content.as_deref()),
8946 Self::Image(_) => ElementStructureRef::None,
8947 Self::ProgressRing(_) => ElementStructureRef::None,
8948 Self::ListBox(_) => ElementStructureRef::None,
8949 Self::Rectangle(_) => ElementStructureRef::None,
8950 Self::Ellipse(_) => ElementStructureRef::None,
8951 Self::Line(_) => ElementStructureRef::None,
8952 Self::SymbolIcon(_) => ElementStructureRef::None,
8953 Self::ImageIcon(_) => ElementStructureRef::None,
8954 Self::FontIcon(_) => ElementStructureRef::None,
8955 Self::BitmapIcon(_) => ElementStructureRef::None,
8956 Self::PathIcon(_) => ElementStructureRef::None,
8957 Self::ListBoxItem(value) => ElementStructureRef::Content(value.content.as_deref()),
8958 Self::RatingControl(_) => ElementStructureRef::None,
8959 Self::Expander(_) => ElementStructureRef::None,
8960 Self::ComboBox(_) => ElementStructureRef::None,
8961 Self::Pivot(_) => ElementStructureRef::None,
8962 Self::PivotItem(value) => ElementStructureRef::Content(value.content.as_deref()),
8963 Self::FlipView(_) => ElementStructureRef::None,
8964 Self::SelectorBar(_) => ElementStructureRef::None,
8965 Self::SelectorBarItem(_) => ElementStructureRef::None,
8966 Self::TabView(_) => ElementStructureRef::None,
8967 Self::TabViewItem(value) => ElementStructureRef::Content(value.content.as_deref()),
8968 Self::TeachingTip(_) => ElementStructureRef::None,
8969 Self::DropDownButton(value) => {
8970 ElementStructureRef::Content(value.content.as_deref())
8971 }
8972 Self::CommandBar(_) => ElementStructureRef::None,
8973 Self::AppBarButton(_) => ElementStructureRef::None,
8974 Self::AppBarSeparator(_) => ElementStructureRef::None,
8975 Self::MenuBar(_) => ElementStructureRef::None,
8976 Self::MenuBarItem(_) => ElementStructureRef::None,
8977 Self::SplitButton(value) => ElementStructureRef::Content(value.content.as_deref()),
8978 Self::ColorPicker(_) => ElementStructureRef::None,
8979 Self::DatePicker(_) => ElementStructureRef::None,
8980 Self::TimePicker(_) => ElementStructureRef::None,
8981 Self::CalendarDatePicker(_) => ElementStructureRef::None,
8982 Self::ToolTip(value) => ElementStructureRef::Content(value.content.as_deref()),
8983 Self::ContentDialog(value) => {
8984 ElementStructureRef::Content(value.content.as_deref())
8985 }
8986 Self::CalendarView(_) => ElementStructureRef::None,
8987 Self::ListView(_) => ElementStructureRef::None,
8988 Self::ListViewItem(value) => ElementStructureRef::Content(value.content.as_deref()),
8989 Self::TreeView(_) => ElementStructureRef::None,
8990 Self::GridView(_) => ElementStructureRef::None,
8991 Self::GridViewItem(value) => ElementStructureRef::Content(value.content.as_deref()),
8992 Self::RelativePanel(value) => {
8993 ElementStructureRef::Children(value.children.as_slice())
8994 }
8995 Self::Canvas(value) => ElementStructureRef::Children(value.children.as_slice()),
8996 Self::RichEditBox(_) => ElementStructureRef::None,
8997 Self::RichTextBlock(_) => ElementStructureRef::None,
8998 Self::Viewbox(_) => ElementStructureRef::None,
8999 Self::WebView2(_) => ElementStructureRef::None,
9000 Self::SwapChainPanel(_) => ElementStructureRef::None,
9001 }
9002 }
9003 fn visit_events(&self, visit: &mut dyn FnMut(EventId, bool)) {
9004 match self {
9005 Self::TextBlock(_) => {}
9006 Self::Button(value) => {
9007 visit(EventId::ButtonClick, value.on_click.is_some());
9008 }
9009 Self::HyperlinkButton(value) => {
9010 visit(EventId::HyperlinkButtonClick, value.on_click.is_some());
9011 }
9012 Self::RepeatButton(value) => {
9013 visit(EventId::RepeatButtonClick, value.on_click.is_some());
9014 }
9015 Self::Border(value) => {
9016 visit(
9017 EventId::BorderDragEnter,
9018 value
9019 .events
9020 .as_ref()
9021 .is_some_and(|events| events.on_drag_enter.is_some())
9022 || !matches!(value.drop_policy, Property::Inherited),
9023 );
9024 visit(
9025 EventId::BorderDragOver,
9026 value
9027 .events
9028 .as_ref()
9029 .is_some_and(|events| events.on_drag_over.is_some())
9030 || !matches!(value.drop_policy, Property::Inherited),
9031 );
9032 visit(
9033 EventId::BorderDragLeave,
9034 value
9035 .events
9036 .as_ref()
9037 .is_some_and(|events| events.on_drag_leave.is_some()),
9038 );
9039 visit(
9040 EventId::BorderDrop,
9041 value
9042 .events
9043 .as_ref()
9044 .is_some_and(|events| events.on_drop.is_some()),
9045 );
9046 visit(
9047 EventId::BorderPointerPressed,
9048 value
9049 .events
9050 .as_ref()
9051 .is_some_and(|events| events.on_pointer_pressed.is_some())
9052 || !matches!(value.capture_pointer_on_press, Property::Inherited),
9053 );
9054 visit(
9055 EventId::BorderPointerMoved,
9056 value
9057 .events
9058 .as_ref()
9059 .is_some_and(|events| events.on_pointer_moved.is_some()),
9060 );
9061 visit(
9062 EventId::BorderPointerEntered,
9063 value
9064 .events
9065 .as_ref()
9066 .is_some_and(|events| events.on_pointer_entered.is_some()),
9067 );
9068 visit(
9069 EventId::BorderPointerExited,
9070 value
9071 .events
9072 .as_ref()
9073 .is_some_and(|events| events.on_pointer_exited.is_some()),
9074 );
9075 visit(
9076 EventId::BorderPointerReleased,
9077 value
9078 .events
9079 .as_ref()
9080 .is_some_and(|events| events.on_pointer_released.is_some()),
9081 );
9082 visit(
9083 EventId::BorderPointerCaptureLost,
9084 value
9085 .events
9086 .as_ref()
9087 .is_some_and(|events| events.on_pointer_capture_lost.is_some()),
9088 );
9089 visit(
9090 EventId::BorderPointerCanceled,
9091 value
9092 .events
9093 .as_ref()
9094 .is_some_and(|events| events.on_pointer_canceled.is_some()),
9095 );
9096 }
9097 Self::BreadcrumbBar(value) => {
9098 visit(
9099 EventId::BreadcrumbBarItemClicked,
9100 value.on_item_clicked.is_some(),
9101 );
9102 }
9103 Self::StackPanel(_) => {}
9104 Self::VariableSizedWrapGrid(_) => {}
9105 Self::Grid(_) => {}
9106 Self::TextBox(_) => {
9107 visit(EventId::TextBoxTextChanged, true);
9108 }
9109 Self::AutoSuggestBox(value) => {
9110 visit(EventId::AutoSuggestBoxTextChanged, true);
9111 visit(
9112 EventId::AutoSuggestBoxSuggestionChosen,
9113 value
9114 .events
9115 .as_ref()
9116 .is_some_and(|events| events.on_suggestion_chosen.is_some()),
9117 );
9118 }
9119 Self::PasswordBox(_) => {
9120 visit(EventId::PasswordBoxPasswordChanged, true);
9121 }
9122 Self::NumberBox(_) => {
9123 visit(EventId::NumberBoxValueChanged, true);
9124 }
9125 Self::Slider(_) => {
9126 visit(EventId::SliderValueChanged, true);
9127 }
9128 Self::TitleBar(value) => {
9129 visit(
9130 EventId::TitleBarBackRequested,
9131 value
9132 .events
9133 .as_ref()
9134 .is_some_and(|events| events.on_back_requested.is_some()),
9135 );
9136 visit(
9137 EventId::TitleBarPaneToggleRequested,
9138 value
9139 .events
9140 .as_ref()
9141 .is_some_and(|events| events.on_pane_toggle_requested.is_some()),
9142 );
9143 }
9144 Self::NavigationView(value) => {
9145 visit(EventId::NavigationViewIsPaneOpenChanged, true);
9146 visit(
9147 EventId::NavigationViewDisplayModeChanged,
9148 value
9149 .events
9150 .as_ref()
9151 .is_some_and(|events| events.on_display_mode_changed.is_some()),
9152 );
9153 visit(EventId::NavigationViewSelectionChanged, true);
9154 }
9155 Self::NavigationViewItem(_) => {}
9156 Self::SplitView(_) => {
9157 visit(EventId::SplitViewPaneClosed, true);
9158 }
9159 Self::ProgressBar(_) => {}
9160 Self::ToggleSwitch(_) => {
9161 visit(EventId::ToggleSwitchToggled, true);
9162 }
9163 Self::CheckBox(_) => {
9164 visit(EventId::CheckBoxIsCheckedChanged, true);
9165 }
9166 Self::ToggleButton(_) => {
9167 visit(EventId::ToggleButtonIsCheckedChanged, true);
9168 }
9169 Self::RadioButton(_) => {
9170 visit(EventId::RadioButtonChecked, true);
9171 }
9172 Self::RadioButtons(_) => {
9173 visit(EventId::RadioButtonsSelectionChanged, true);
9174 }
9175 Self::ItemsRepeater(_) => {}
9176 Self::InfoBadge(_) => {}
9177 Self::InfoBar(value) => {
9178 visit(EventId::InfoBarClosed, value.on_closed.is_some());
9179 }
9180 Self::PersonPicture(_) => {}
9181 Self::ScrollViewer(_) => {}
9182 Self::ScrollView(_) => {}
9183 Self::Image(value) => {
9184 visit(
9185 EventId::ImageImageOpened,
9186 value
9187 .events
9188 .as_ref()
9189 .is_some_and(|events| events.on_opened.is_some()),
9190 );
9191 visit(
9192 EventId::ImageImageFailed,
9193 value
9194 .events
9195 .as_ref()
9196 .is_some_and(|events| events.on_failed.is_some()),
9197 );
9198 }
9199 Self::ProgressRing(_) => {}
9200 Self::ListBox(_) => {
9201 visit(EventId::ListBoxSelectionChanged, true);
9202 }
9203 Self::Rectangle(_) => {}
9204 Self::Ellipse(_) => {}
9205 Self::Line(_) => {}
9206 Self::SymbolIcon(_) => {}
9207 Self::ImageIcon(_) => {}
9208 Self::FontIcon(_) => {}
9209 Self::BitmapIcon(_) => {}
9210 Self::PathIcon(_) => {}
9211 Self::ListBoxItem(_) => {}
9212 Self::RatingControl(_) => {
9213 visit(EventId::RatingControlValueChanged, true);
9214 }
9215 Self::Expander(_) => {
9216 visit(EventId::ExpanderIsExpandedChanged, true);
9217 }
9218 Self::ComboBox(_) => {
9219 visit(EventId::ComboBoxSelectionChanged, true);
9220 }
9221 Self::Pivot(_) => {
9222 visit(EventId::PivotSelectionChanged, true);
9223 }
9224 Self::PivotItem(_) => {}
9225 Self::FlipView(_) => {
9226 visit(EventId::FlipViewSelectionChanged, true);
9227 }
9228 Self::SelectorBar(_) => {
9229 visit(EventId::SelectorBarSelectionChanged, true);
9230 }
9231 Self::SelectorBarItem(_) => {}
9232 Self::TabView(value) => {
9233 visit(EventId::TabViewSelectionChanged, true);
9234 visit(
9235 EventId::TabViewTabCloseRequested,
9236 value
9237 .events
9238 .as_ref()
9239 .is_some_and(|events| events.on_close_requested.is_some()),
9240 );
9241 visit(
9242 EventId::TabViewAddTabButtonClick,
9243 value
9244 .events
9245 .as_ref()
9246 .is_some_and(|events| events.on_add_tab_button_click.is_some()),
9247 );
9248 visit(
9249 EventId::TabViewTabItemsChanged,
9250 value
9251 .events
9252 .as_ref()
9253 .is_some_and(|events| events.on_reordered.is_some()),
9254 );
9255 }
9256 Self::TabViewItem(_) => {}
9257 Self::TeachingTip(value) => {
9258 visit(
9259 EventId::TeachingTipClosed,
9260 value
9261 .events
9262 .as_ref()
9263 .is_some_and(|events| events.on_closed.is_some()),
9264 );
9265 visit(
9266 EventId::TeachingTipActionButtonClick,
9267 value
9268 .events
9269 .as_ref()
9270 .is_some_and(|events| events.on_action_button_click.is_some()),
9271 );
9272 }
9273 Self::DropDownButton(value) => {
9274 visit(EventId::DropDownButtonClick, value.on_click.is_some());
9275 }
9276 Self::CommandBar(_) => {}
9277 Self::AppBarButton(value) => {
9278 visit(EventId::AppBarButtonClick, value.on_click.is_some());
9279 }
9280 Self::AppBarSeparator(_) => {}
9281 Self::MenuBar(_) => {}
9282 Self::MenuBarItem(_) => {}
9283 Self::SplitButton(value) => {
9284 visit(EventId::SplitButtonClick, value.on_click.is_some());
9285 }
9286 Self::ColorPicker(_) => {
9287 visit(EventId::ColorPickerColorChanged, true);
9288 }
9289 Self::DatePicker(value) => {
9290 visit(
9291 EventId::DatePickerSelectedDateChanged,
9292 value.on_selected_date_changed.is_some(),
9293 );
9294 }
9295 Self::TimePicker(value) => {
9296 visit(
9297 EventId::TimePickerSelectedTimeChanged,
9298 value.on_selected_time_changed.is_some(),
9299 );
9300 }
9301 Self::CalendarDatePicker(value) => {
9302 visit(
9303 EventId::CalendarDatePickerDateChanged,
9304 value.on_date_changed.is_some(),
9305 );
9306 }
9307 Self::ToolTip(_) => {}
9308 Self::ContentDialog(_) => {
9309 visit(EventId::ContentDialogClosed, true);
9310 }
9311 Self::CalendarView(value) => {
9312 visit(
9313 EventId::CalendarViewSelectedDatesChanged,
9314 value.on_selected_dates_changed.is_some(),
9315 );
9316 }
9317 Self::ListView(value) => {
9318 visit(EventId::ListViewSelectionChanged, true);
9319 visit(
9320 EventId::ListViewDragItemsCompleted,
9321 value
9322 .events
9323 .as_ref()
9324 .is_some_and(|events| events.on_reordered.is_some()),
9325 );
9326 }
9327 Self::ListViewItem(_) => {}
9328 Self::TreeView(value) => {
9329 visit(
9330 EventId::TreeViewItemInvoked,
9331 value.on_item_invoked.is_some(),
9332 );
9333 }
9334 Self::GridView(value) => {
9335 visit(
9336 EventId::GridViewDragItemsCompleted,
9337 value
9338 .events
9339 .as_ref()
9340 .is_some_and(|events| events.on_reordered.is_some()),
9341 );
9342 visit(EventId::GridViewSelectionChanged, true);
9343 }
9344 Self::GridViewItem(_) => {}
9345 Self::RelativePanel(_) => {}
9346 Self::Canvas(_) => {}
9347 Self::RichEditBox(_) => {
9348 visit(EventId::RichEditBoxTextChanged, true);
9349 }
9350 Self::RichTextBlock(_) => {}
9351 Self::Viewbox(_) => {}
9352 Self::WebView2(_) => {}
9353 Self::SwapChainPanel(_) => {}
9354 }
9355 }
9356 }
9357}
9358use public::*;
9359pub trait ElementPartsExt {
9360 fn kind(&self) -> MountedKind;
9361 fn into_parts(self) -> ElementParts;
9362 fn props_match(&self, props: &MountedProps) -> bool;
9363 fn reference(&self) -> Option<&NativeElementRef>;
9364 fn element_state(&self) -> Option<&ElementState>;
9365 fn window_title_bar(&self) -> Option<WindowTitleBarHeight>;
9366 fn structure(&self) -> ElementStructureRef<'_>;
9367 fn visit_events(&self, visit: &mut dyn FnMut(EventId, bool));
9368}
9369pub trait MountedPropsExt {
9370 fn visit_properties(&self, visit: &mut dyn FnMut(PropertyId, Option<PropertyValueRef<'_>>));
9371 fn theme_style(&self) -> ThemeStyle;
9372}
9373pub trait MountedEventsExt {
9374 fn visit_events(&self, visit: &mut dyn FnMut(EventId, bool));
9375 fn dispatch_event(&self, event: EventId, payload: &EventPayload) -> Option<bool>;
9376 fn observe_event(
9377 &self,
9378 event: EventId,
9379 payload: &EventPayload,
9380 ) -> Option<(PropertyId, PropertyValue)>;
9381}
9382impl MountedPropsExt for MountedProps {
9383 fn visit_properties(&self, visit: &mut dyn FnMut(PropertyId, Option<PropertyValueRef<'_>>)) {
9384 match self {
9385 Self::TextBlock(values) => {
9386 visit(
9387 PropertyId::TextBlockText,
9388 match &values.text {
9389 Property::Inherited => None,
9390 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
9391 },
9392 );
9393 visit(
9394 PropertyId::TextBlockTextWrapping,
9395 match &values.text_wrapping {
9396 Property::Inherited => None,
9397 Property::Set(value) => Some(PropertyValueRef::TextWrapping(*value)),
9398 },
9399 );
9400 visit(
9401 PropertyId::TextBlockFontSize,
9402 match &values.font_size {
9403 Property::Inherited => None,
9404 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9405 },
9406 );
9407 visit(
9408 PropertyId::TextBlockFontWeight,
9409 match &values.font_weight {
9410 Property::Inherited => None,
9411 Property::Set(value) => Some(PropertyValueRef::FontWeight(*value)),
9412 },
9413 );
9414 visit(
9415 PropertyId::TextBlockIsTextSelectionEnabled,
9416 match &values.is_text_selection_enabled {
9417 Property::Inherited => None,
9418 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9419 },
9420 );
9421 visit(
9422 PropertyId::TextBlockMaxLines,
9423 match &values.max_lines {
9424 Property::Inherited => None,
9425 Property::Set(value) => Some(PropertyValueRef::I32(*value)),
9426 },
9427 );
9428 visit(
9429 PropertyId::TextBlockTextTrimming,
9430 match &values.text_trimming {
9431 Property::Inherited => None,
9432 Property::Set(value) => Some(PropertyValueRef::TextTrimming(*value)),
9433 },
9434 );
9435 visit(
9436 PropertyId::TextBlockForeground,
9437 match &values.foreground {
9438 Property::Set(Brush::Solid(color)) => {
9439 Some(PropertyValueRef::Brush(Brush::Solid(*color)))
9440 }
9441 Property::Inherited | Property::Set(Brush::Theme(_)) => None,
9442 },
9443 );
9444 }
9445 Self::Button(values) => {
9446 visit(
9447 PropertyId::ButtonIsEnabled,
9448 match &values.is_enabled {
9449 Property::Inherited => None,
9450 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9451 },
9452 );
9453 visit(
9454 PropertyId::ButtonHorizontalContentAlignment,
9455 match &values.horizontal_content_alignment {
9456 Property::Inherited => None,
9457 Property::Set(value) => Some(PropertyValueRef::HorizontalAlignment(*value)),
9458 },
9459 );
9460 visit(
9461 PropertyId::ButtonVerticalContentAlignment,
9462 match &values.vertical_content_alignment {
9463 Property::Inherited => None,
9464 Property::Set(value) => Some(PropertyValueRef::VerticalAlignment(*value)),
9465 },
9466 );
9467 visit(
9468 PropertyId::ButtonResources,
9469 match &values.resource_overrides {
9470 Property::Inherited => None,
9471 Property::Set(value) => Some(PropertyValueRef::ResourceOverrides(value)),
9472 },
9473 );
9474 visit(
9475 PropertyId::ButtonStyle,
9476 match &values.style {
9477 Property::Inherited => None,
9478 Property::Set(value) => Some(PropertyValueRef::ButtonStyle(*value)),
9479 },
9480 );
9481 visit(
9482 PropertyId::ButtonKeyboardAccelerators,
9483 match &values.key_accelerators {
9484 Property::Inherited => None,
9485 Property::Set(value) => Some(PropertyValueRef::KeyAccelerators(value)),
9486 },
9487 );
9488 }
9489 Self::HyperlinkButton(values) => {
9490 visit(
9491 PropertyId::HyperlinkButtonNavigateUri,
9492 match &values.navigate_uri {
9493 Property::Inherited => None,
9494 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
9495 },
9496 );
9497 visit(
9498 PropertyId::HyperlinkButtonIsEnabled,
9499 match &values.is_enabled {
9500 Property::Inherited => None,
9501 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9502 },
9503 );
9504 }
9505 Self::RepeatButton(values) => {
9506 visit(
9507 PropertyId::RepeatButtonDelay,
9508 match &values.delay {
9509 Property::Inherited => None,
9510 Property::Set(value) => Some(PropertyValueRef::I32(*value)),
9511 },
9512 );
9513 visit(
9514 PropertyId::RepeatButtonInterval,
9515 match &values.interval {
9516 Property::Inherited => None,
9517 Property::Set(value) => Some(PropertyValueRef::I32(*value)),
9518 },
9519 );
9520 visit(
9521 PropertyId::RepeatButtonIsEnabled,
9522 match &values.is_enabled {
9523 Property::Inherited => None,
9524 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9525 },
9526 );
9527 }
9528 Self::Border(values) => {
9529 visit(
9530 PropertyId::BorderPadding,
9531 match &values.padding {
9532 Property::Inherited => None,
9533 Property::Set(value) => Some(PropertyValueRef::Thickness(value)),
9534 },
9535 );
9536 visit(
9537 PropertyId::BorderBorderThickness,
9538 match &values.border_thickness {
9539 Property::Inherited => None,
9540 Property::Set(value) => Some(PropertyValueRef::Thickness(value)),
9541 },
9542 );
9543 visit(
9544 PropertyId::BorderCornerRadius,
9545 match &values.corner_radius {
9546 Property::Inherited => None,
9547 Property::Set(value) => Some(PropertyValueRef::CornerRadius(value)),
9548 },
9549 );
9550 visit(
9551 PropertyId::BorderBackground,
9552 match &values.background {
9553 Property::Set(Brush::Solid(color)) => {
9554 Some(PropertyValueRef::Brush(Brush::Solid(*color)))
9555 }
9556 Property::Inherited | Property::Set(Brush::Theme(_)) => None,
9557 },
9558 );
9559 visit(
9560 PropertyId::BorderBorderBrush,
9561 match &values.border_brush {
9562 Property::Set(Brush::Solid(color)) => {
9563 Some(PropertyValueRef::Brush(Brush::Solid(*color)))
9564 }
9565 Property::Inherited | Property::Set(Brush::Theme(_)) => None,
9566 },
9567 );
9568 visit(
9569 PropertyId::BorderOpacityTransition,
9570 match &values.opacity_transition {
9571 Property::Inherited => None,
9572 Property::Set(value) => Some(PropertyValueRef::Duration(*value)),
9573 },
9574 );
9575 visit(
9576 PropertyId::BorderScale,
9577 match &values.scale {
9578 Property::Inherited => None,
9579 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9580 },
9581 );
9582 visit(
9583 PropertyId::BorderScaleTransition,
9584 match &values.scale_transition {
9585 Property::Inherited => None,
9586 Property::Set(value) => Some(PropertyValueRef::Duration(*value)),
9587 },
9588 );
9589 visit(
9590 PropertyId::BorderCapturePointerOnPress,
9591 match &values.capture_pointer_on_press {
9592 Property::Inherited => None,
9593 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9594 },
9595 );
9596 visit(
9597 PropertyId::BorderAllowDrop,
9598 match &values.drop_policy {
9599 Property::Inherited => None,
9600 Property::Set(value) => Some(PropertyValueRef::DragDropPolicy(value)),
9601 },
9602 );
9603 }
9604 Self::BreadcrumbBar(values) => {
9605 visit(
9606 PropertyId::BreadcrumbBarItemsSource,
9607 match &values.items_source {
9608 Property::Inherited => None,
9609 Property::Set(value) => Some(PropertyValueRef::StrList(value)),
9610 },
9611 );
9612 }
9613 Self::StackPanel(values) => {
9614 visit(
9615 PropertyId::StackPanelOrientation,
9616 match &values.orientation {
9617 Property::Inherited => None,
9618 Property::Set(value) => Some(PropertyValueRef::Orientation(*value)),
9619 },
9620 );
9621 visit(
9622 PropertyId::StackPanelSpacing,
9623 match &values.spacing {
9624 Property::Inherited => None,
9625 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9626 },
9627 );
9628 }
9629 Self::VariableSizedWrapGrid(values) => {
9630 visit(
9631 PropertyId::VariableSizedWrapGridItemWidth,
9632 match &values.item_width {
9633 Property::Inherited => None,
9634 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9635 },
9636 );
9637 visit(
9638 PropertyId::VariableSizedWrapGridItemHeight,
9639 match &values.item_height {
9640 Property::Inherited => None,
9641 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9642 },
9643 );
9644 visit(
9645 PropertyId::VariableSizedWrapGridOrientation,
9646 match &values.orientation {
9647 Property::Inherited => None,
9648 Property::Set(value) => Some(PropertyValueRef::Orientation(*value)),
9649 },
9650 );
9651 }
9652 Self::Grid(values) => {
9653 visit(
9654 PropertyId::GridRowSpacing,
9655 match &values.row_spacing {
9656 Property::Inherited => None,
9657 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9658 },
9659 );
9660 visit(
9661 PropertyId::GridColumnSpacing,
9662 match &values.column_spacing {
9663 Property::Inherited => None,
9664 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9665 },
9666 );
9667 visit(
9668 PropertyId::GridKeyboardAccelerators,
9669 match &values.key_accelerators {
9670 Property::Inherited => None,
9671 Property::Set(value) => Some(PropertyValueRef::KeyAccelerators(value)),
9672 },
9673 );
9674 visit(
9675 PropertyId::GridBackground,
9676 match &values.background {
9677 Property::Set(Brush::Solid(color)) => {
9678 Some(PropertyValueRef::Brush(Brush::Solid(*color)))
9679 }
9680 Property::Inherited | Property::Set(Brush::Theme(_)) => None,
9681 },
9682 );
9683 visit(
9684 PropertyId::GridRows,
9685 values.rows.as_set().map(PropertyValueRef::GridLengths),
9686 );
9687 visit(
9688 PropertyId::GridColumns,
9689 values.columns.as_set().map(PropertyValueRef::GridLengths),
9690 );
9691 }
9692 Self::TextBox(values) => {
9693 visit(
9694 PropertyId::TextBoxText,
9695 match &values.text {
9696 Property::Inherited => None,
9697 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
9698 },
9699 );
9700 visit(
9701 PropertyId::TextBoxPlaceholderText,
9702 match &values.placeholder_text {
9703 Property::Inherited => None,
9704 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
9705 },
9706 );
9707 visit(
9708 PropertyId::TextBoxIsEnabled,
9709 match &values.is_enabled {
9710 Property::Inherited => None,
9711 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9712 },
9713 );
9714 visit(
9715 PropertyId::TextBoxAcceptsReturn,
9716 match &values.accepts_return {
9717 Property::Inherited => None,
9718 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9719 },
9720 );
9721 visit(
9722 PropertyId::TextBoxTextWrapping,
9723 match &values.text_wrapping {
9724 Property::Inherited => None,
9725 Property::Set(value) => Some(PropertyValueRef::TextWrapping(*value)),
9726 },
9727 );
9728 visit(
9729 PropertyId::TextBoxBackground,
9730 match &values.background {
9731 Property::Set(Brush::Solid(color)) => {
9732 Some(PropertyValueRef::Brush(Brush::Solid(*color)))
9733 }
9734 Property::Inherited | Property::Set(Brush::Theme(_)) => None,
9735 },
9736 );
9737 visit(
9738 PropertyId::TextBoxBorderBrush,
9739 match &values.border_brush {
9740 Property::Set(Brush::Solid(color)) => {
9741 Some(PropertyValueRef::Brush(Brush::Solid(*color)))
9742 }
9743 Property::Inherited | Property::Set(Brush::Theme(_)) => None,
9744 },
9745 );
9746 visit(
9747 PropertyId::TextBoxBorderThickness,
9748 match &values.border_thickness {
9749 Property::Inherited => None,
9750 Property::Set(value) => Some(PropertyValueRef::Thickness(value)),
9751 },
9752 );
9753 }
9754 Self::AutoSuggestBox(values) => {
9755 visit(
9756 PropertyId::AutoSuggestBoxText,
9757 match &values.text {
9758 Property::Inherited => None,
9759 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
9760 },
9761 );
9762 visit(
9763 PropertyId::AutoSuggestBoxItemsSource,
9764 match &values.items_source {
9765 Property::Inherited => None,
9766 Property::Set(value) => Some(PropertyValueRef::StrList(value)),
9767 },
9768 );
9769 visit(
9770 PropertyId::AutoSuggestBoxPlaceholderText,
9771 match &values.placeholder_text {
9772 Property::Inherited => None,
9773 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
9774 },
9775 );
9776 visit(
9777 PropertyId::AutoSuggestBoxIsEnabled,
9778 match &values.is_enabled {
9779 Property::Inherited => None,
9780 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9781 },
9782 );
9783 }
9784 Self::PasswordBox(values) => {
9785 visit(
9786 PropertyId::PasswordBoxPassword,
9787 match &values.password {
9788 Property::Inherited => None,
9789 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
9790 },
9791 );
9792 visit(
9793 PropertyId::PasswordBoxPlaceholderText,
9794 match &values.placeholder_text {
9795 Property::Inherited => None,
9796 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
9797 },
9798 );
9799 visit(
9800 PropertyId::PasswordBoxPasswordRevealMode,
9801 match &values.password_reveal_mode {
9802 Property::Inherited => None,
9803 Property::Set(value) => Some(PropertyValueRef::PasswordRevealMode(*value)),
9804 },
9805 );
9806 visit(
9807 PropertyId::PasswordBoxIsEnabled,
9808 match &values.is_enabled {
9809 Property::Inherited => None,
9810 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9811 },
9812 );
9813 }
9814 Self::NumberBox(values) => {
9815 visit(
9816 PropertyId::NumberBoxMinimum,
9817 match &values.minimum {
9818 Property::Inherited => None,
9819 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9820 },
9821 );
9822 visit(
9823 PropertyId::NumberBoxMaximum,
9824 match &values.maximum {
9825 Property::Inherited => None,
9826 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9827 },
9828 );
9829 visit(
9830 PropertyId::NumberBoxValue,
9831 match &values.value {
9832 Property::Inherited => None,
9833 Property::Set(value) => Some(PropertyValueRef::OptionalF64(*value)),
9834 },
9835 );
9836 visit(
9837 PropertyId::NumberBoxIsEnabled,
9838 match &values.is_enabled {
9839 Property::Inherited => None,
9840 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9841 },
9842 );
9843 }
9844 Self::Slider(values) => {
9845 visit(
9846 PropertyId::SliderMinimum,
9847 match &values.minimum {
9848 Property::Inherited => None,
9849 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9850 },
9851 );
9852 visit(
9853 PropertyId::SliderMaximum,
9854 match &values.maximum {
9855 Property::Inherited => None,
9856 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9857 },
9858 );
9859 visit(
9860 PropertyId::SliderValue,
9861 match &values.value {
9862 Property::Inherited => None,
9863 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9864 },
9865 );
9866 visit(
9867 PropertyId::SliderIsEnabled,
9868 match &values.is_enabled {
9869 Property::Inherited => None,
9870 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9871 },
9872 );
9873 visit(
9874 PropertyId::SliderStepFrequency,
9875 match &values.step_frequency {
9876 Property::Inherited => None,
9877 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9878 },
9879 );
9880 visit(
9881 PropertyId::SliderOrientation,
9882 match &values.orientation {
9883 Property::Inherited => None,
9884 Property::Set(value) => Some(PropertyValueRef::Orientation(*value)),
9885 },
9886 );
9887 }
9888 Self::TitleBar(values) => {
9889 visit(
9890 PropertyId::TitleBarTitle,
9891 match &values.title {
9892 Property::Inherited => None,
9893 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
9894 },
9895 );
9896 visit(
9897 PropertyId::TitleBarSubtitle,
9898 match &values.subtitle {
9899 Property::Inherited => None,
9900 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
9901 },
9902 );
9903 visit(
9904 PropertyId::TitleBarIsBackButtonVisible,
9905 match &values.is_back_button_visible {
9906 Property::Inherited => None,
9907 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9908 },
9909 );
9910 visit(
9911 PropertyId::TitleBarIsBackButtonEnabled,
9912 match &values.is_back_button_enabled {
9913 Property::Inherited => None,
9914 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9915 },
9916 );
9917 visit(
9918 PropertyId::TitleBarIsPaneToggleButtonVisible,
9919 match &values.is_pane_toggle_button_visible {
9920 Property::Inherited => None,
9921 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9922 },
9923 );
9924 }
9925 Self::NavigationView(values) => {
9926 visit(
9927 PropertyId::NavigationViewIsEnabled,
9928 match &values.is_enabled {
9929 Property::Inherited => None,
9930 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9931 },
9932 );
9933 visit(
9934 PropertyId::NavigationViewPaneDisplayMode,
9935 match &values.pane_display_mode {
9936 Property::Inherited => None,
9937 Property::Set(value) => {
9938 Some(PropertyValueRef::NavigationViewPaneDisplayMode(*value))
9939 }
9940 },
9941 );
9942 visit(
9943 PropertyId::NavigationViewIsPaneToggleButtonVisible,
9944 match &values.is_pane_toggle_button_visible {
9945 Property::Inherited => None,
9946 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9947 },
9948 );
9949 visit(
9950 PropertyId::NavigationViewIsBackButtonVisible,
9951 match &values.is_back_button_visible {
9952 Property::Inherited => None,
9953 Property::Set(value) => {
9954 Some(PropertyValueRef::NavigationViewBackButtonVisible(*value))
9955 }
9956 },
9957 );
9958 visit(
9959 PropertyId::NavigationViewIsSettingsVisible,
9960 match &values.is_settings_visible {
9961 Property::Inherited => None,
9962 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9963 },
9964 );
9965 visit(
9966 PropertyId::NavigationViewAlwaysShowHeader,
9967 match &values.always_show_header {
9968 Property::Inherited => None,
9969 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9970 },
9971 );
9972 visit(
9973 PropertyId::NavigationViewPaneTitle,
9974 match &values.pane_title {
9975 Property::Inherited => None,
9976 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
9977 },
9978 );
9979 visit(
9980 PropertyId::NavigationViewOpenPaneLength,
9981 match &values.open_pane_length {
9982 Property::Inherited => None,
9983 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
9984 },
9985 );
9986 visit(
9987 PropertyId::NavigationViewIsPaneOpen,
9988 match &values.is_pane_open {
9989 Property::Inherited => None,
9990 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
9991 },
9992 );
9993 }
9994 Self::NavigationViewItem(values) => {
9995 visit(
9996 PropertyId::NavigationViewItemTag,
9997 match &values.tag {
9998 Property::Inherited => None,
9999 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10000 },
10001 );
10002 visit(
10003 PropertyId::NavigationViewItemIsSelected,
10004 match &values.is_selected {
10005 Property::Inherited => None,
10006 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10007 },
10008 );
10009 visit(
10010 PropertyId::NavigationViewItemSelectsOnInvoked,
10011 match &values.selects_on_invoked {
10012 Property::Inherited => None,
10013 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10014 },
10015 );
10016 visit(
10017 PropertyId::NavigationViewItemIsExpanded,
10018 match &values.is_expanded {
10019 Property::Inherited => None,
10020 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10021 },
10022 );
10023 }
10024 Self::SplitView(values) => {
10025 visit(
10026 PropertyId::SplitViewOpenPaneLength,
10027 match &values.open_pane_length {
10028 Property::Inherited => None,
10029 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10030 },
10031 );
10032 visit(
10033 PropertyId::SplitViewCompactPaneLength,
10034 match &values.compact_pane_length {
10035 Property::Inherited => None,
10036 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10037 },
10038 );
10039 visit(
10040 PropertyId::SplitViewDisplayMode,
10041 match &values.display_mode {
10042 Property::Inherited => None,
10043 Property::Set(value) => {
10044 Some(PropertyValueRef::SplitViewDisplayMode(*value))
10045 }
10046 },
10047 );
10048 visit(
10049 PropertyId::SplitViewIsPaneOpen,
10050 match &values.is_pane_open {
10051 Property::Inherited => None,
10052 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10053 },
10054 );
10055 }
10056 Self::ProgressBar(values) => {
10057 visit(
10058 PropertyId::ProgressBarMinimum,
10059 match &values.minimum {
10060 Property::Inherited => None,
10061 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10062 },
10063 );
10064 visit(
10065 PropertyId::ProgressBarMaximum,
10066 match &values.maximum {
10067 Property::Inherited => None,
10068 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10069 },
10070 );
10071 visit(
10072 PropertyId::ProgressBarValue,
10073 match &values.value {
10074 Property::Inherited => None,
10075 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10076 },
10077 );
10078 visit(
10079 PropertyId::ProgressBarIsIndeterminate,
10080 match &values.is_indeterminate {
10081 Property::Inherited => None,
10082 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10083 },
10084 );
10085 visit(
10086 PropertyId::ProgressBarShowError,
10087 match &values.show_error {
10088 Property::Inherited => None,
10089 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10090 },
10091 );
10092 visit(
10093 PropertyId::ProgressBarShowPaused,
10094 match &values.show_paused {
10095 Property::Inherited => None,
10096 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10097 },
10098 );
10099 visit(
10100 PropertyId::ProgressBarIsEnabled,
10101 match &values.is_enabled {
10102 Property::Inherited => None,
10103 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10104 },
10105 );
10106 }
10107 Self::ToggleSwitch(values) => {
10108 visit(
10109 PropertyId::ToggleSwitchIsOn,
10110 match &values.is_on {
10111 Property::Inherited => None,
10112 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10113 },
10114 );
10115 visit(
10116 PropertyId::ToggleSwitchIsEnabled,
10117 match &values.is_enabled {
10118 Property::Inherited => None,
10119 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10120 },
10121 );
10122 }
10123 Self::CheckBox(values) => {
10124 visit(
10125 PropertyId::CheckBoxIsChecked,
10126 match &values.is_checked {
10127 Property::Inherited => None,
10128 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10129 },
10130 );
10131 visit(
10132 PropertyId::CheckBoxIsEnabled,
10133 match &values.is_enabled {
10134 Property::Inherited => None,
10135 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10136 },
10137 );
10138 }
10139 Self::ToggleButton(values) => {
10140 visit(
10141 PropertyId::ToggleButtonIsChecked,
10142 match &values.is_checked {
10143 Property::Inherited => None,
10144 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10145 },
10146 );
10147 visit(
10148 PropertyId::ToggleButtonIsEnabled,
10149 match &values.is_enabled {
10150 Property::Inherited => None,
10151 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10152 },
10153 );
10154 }
10155 Self::RadioButton(values) => {
10156 visit(
10157 PropertyId::RadioButtonGroupName,
10158 match &values.group_name {
10159 Property::Inherited => None,
10160 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10161 },
10162 );
10163 visit(
10164 PropertyId::RadioButtonIsChecked,
10165 match &values.is_checked {
10166 Property::Inherited => None,
10167 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10168 },
10169 );
10170 visit(
10171 PropertyId::RadioButtonIsEnabled,
10172 match &values.is_enabled {
10173 Property::Inherited => None,
10174 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10175 },
10176 );
10177 }
10178 Self::RadioButtons(values) => {
10179 visit(
10180 PropertyId::RadioButtonsItemsSource,
10181 match &values.items_source {
10182 Property::Inherited => None,
10183 Property::Set(value) => Some(PropertyValueRef::StrList(value)),
10184 },
10185 );
10186 visit(
10187 PropertyId::RadioButtonsSelectedIndex,
10188 match &values.selected_index {
10189 Property::Inherited => None,
10190 Property::Set(value) => Some(PropertyValueRef::SelectionIndex(*value)),
10191 },
10192 );
10193 visit(
10194 PropertyId::RadioButtonsMaxColumns,
10195 match &values.max_columns {
10196 Property::Inherited => None,
10197 Property::Set(value) => Some(PropertyValueRef::I32(*value)),
10198 },
10199 );
10200 }
10201 Self::ItemsRepeater(_) => {}
10202 Self::InfoBadge(values) => {
10203 visit(
10204 PropertyId::InfoBadgeValue,
10205 match &values.value {
10206 Property::Inherited => None,
10207 Property::Set(value) => Some(PropertyValueRef::I32(*value)),
10208 },
10209 );
10210 }
10211 Self::InfoBar(values) => {
10212 visit(
10213 PropertyId::InfoBarTitle,
10214 match &values.title {
10215 Property::Inherited => None,
10216 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10217 },
10218 );
10219 visit(
10220 PropertyId::InfoBarMessage,
10221 match &values.message {
10222 Property::Inherited => None,
10223 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10224 },
10225 );
10226 visit(
10227 PropertyId::InfoBarSeverity,
10228 match &values.severity {
10229 Property::Inherited => None,
10230 Property::Set(value) => Some(PropertyValueRef::InfoBarSeverity(*value)),
10231 },
10232 );
10233 visit(
10234 PropertyId::InfoBarIsOpen,
10235 match &values.is_open {
10236 Property::Inherited => None,
10237 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10238 },
10239 );
10240 visit(
10241 PropertyId::InfoBarIsClosable,
10242 match &values.is_closable {
10243 Property::Inherited => None,
10244 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10245 },
10246 );
10247 }
10248 Self::PersonPicture(values) => {
10249 visit(
10250 PropertyId::PersonPictureDisplayName,
10251 match &values.display_name {
10252 Property::Inherited => None,
10253 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10254 },
10255 );
10256 visit(
10257 PropertyId::PersonPictureInitials,
10258 match &values.initials {
10259 Property::Inherited => None,
10260 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10261 },
10262 );
10263 }
10264 Self::ScrollViewer(values) => {
10265 visit(
10266 PropertyId::ScrollViewerHorizontalScrollBarVisibility,
10267 match &values.horizontal_scroll_bar_visibility {
10268 Property::Inherited => None,
10269 Property::Set(value) => Some(PropertyValueRef::ScrollBarVisibility(*value)),
10270 },
10271 );
10272 visit(
10273 PropertyId::ScrollViewerVerticalScrollBarVisibility,
10274 match &values.vertical_scroll_bar_visibility {
10275 Property::Inherited => None,
10276 Property::Set(value) => Some(PropertyValueRef::ScrollBarVisibility(*value)),
10277 },
10278 );
10279 }
10280 Self::ScrollView(values) => {
10281 visit(
10282 PropertyId::ScrollViewHorizontalScrollBarVisibility,
10283 match &values.horizontal_scroll_bar_visibility {
10284 Property::Inherited => None,
10285 Property::Set(value) => {
10286 Some(PropertyValueRef::ScrollingScrollBarVisibility(*value))
10287 }
10288 },
10289 );
10290 visit(
10291 PropertyId::ScrollViewVerticalScrollBarVisibility,
10292 match &values.vertical_scroll_bar_visibility {
10293 Property::Inherited => None,
10294 Property::Set(value) => {
10295 Some(PropertyValueRef::ScrollingScrollBarVisibility(*value))
10296 }
10297 },
10298 );
10299 }
10300 Self::Image(values) => {
10301 visit(
10302 PropertyId::ImageSource,
10303 match &values.source {
10304 Property::Inherited => None,
10305 Property::Set(ImageValue::Uri(value)) => {
10306 Some(PropertyValueRef::Str(value.as_str()))
10307 }
10308 Property::Set(ImageValue::Encoded(value)) => {
10309 Some(PropertyValueRef::EncodedImage(value))
10310 }
10311 },
10312 );
10313 visit(
10314 PropertyId::ImageStretch,
10315 match &values.stretch {
10316 Property::Inherited => None,
10317 Property::Set(value) => Some(PropertyValueRef::Stretch(*value)),
10318 },
10319 );
10320 }
10321 Self::ProgressRing(values) => {
10322 visit(
10323 PropertyId::ProgressRingMinimum,
10324 match &values.minimum {
10325 Property::Inherited => None,
10326 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10327 },
10328 );
10329 visit(
10330 PropertyId::ProgressRingMaximum,
10331 match &values.maximum {
10332 Property::Inherited => None,
10333 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10334 },
10335 );
10336 visit(
10337 PropertyId::ProgressRingValue,
10338 match &values.value {
10339 Property::Inherited => None,
10340 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10341 },
10342 );
10343 visit(
10344 PropertyId::ProgressRingIsIndeterminate,
10345 match &values.is_indeterminate {
10346 Property::Inherited => None,
10347 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10348 },
10349 );
10350 visit(
10351 PropertyId::ProgressRingIsActive,
10352 match &values.is_active {
10353 Property::Inherited => None,
10354 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10355 },
10356 );
10357 visit(
10358 PropertyId::ProgressRingIsEnabled,
10359 match &values.is_enabled {
10360 Property::Inherited => None,
10361 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10362 },
10363 );
10364 }
10365 Self::ListBox(values) => {
10366 visit(
10367 PropertyId::ListBoxIsEnabled,
10368 match &values.is_enabled {
10369 Property::Inherited => None,
10370 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10371 },
10372 );
10373 }
10374 Self::Rectangle(values) => {
10375 visit(
10376 PropertyId::RectangleFill,
10377 match &values.fill {
10378 Property::Set(Brush::Solid(color)) => {
10379 Some(PropertyValueRef::Brush(Brush::Solid(*color)))
10380 }
10381 Property::Inherited | Property::Set(Brush::Theme(_)) => None,
10382 },
10383 );
10384 visit(
10385 PropertyId::RectangleStroke,
10386 match &values.stroke {
10387 Property::Set(Brush::Solid(color)) => {
10388 Some(PropertyValueRef::Brush(Brush::Solid(*color)))
10389 }
10390 Property::Inherited | Property::Set(Brush::Theme(_)) => None,
10391 },
10392 );
10393 visit(
10394 PropertyId::RectangleStrokeThickness,
10395 match &values.stroke_thickness {
10396 Property::Inherited => None,
10397 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10398 },
10399 );
10400 visit(
10401 PropertyId::RectangleRadiusX,
10402 match &values.radius_x {
10403 Property::Inherited => None,
10404 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10405 },
10406 );
10407 visit(
10408 PropertyId::RectangleRadiusY,
10409 match &values.radius_y {
10410 Property::Inherited => None,
10411 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10412 },
10413 );
10414 }
10415 Self::Ellipse(values) => {
10416 visit(
10417 PropertyId::EllipseFill,
10418 match &values.fill {
10419 Property::Set(Brush::Solid(color)) => {
10420 Some(PropertyValueRef::Brush(Brush::Solid(*color)))
10421 }
10422 Property::Inherited | Property::Set(Brush::Theme(_)) => None,
10423 },
10424 );
10425 visit(
10426 PropertyId::EllipseStroke,
10427 match &values.stroke {
10428 Property::Set(Brush::Solid(color)) => {
10429 Some(PropertyValueRef::Brush(Brush::Solid(*color)))
10430 }
10431 Property::Inherited | Property::Set(Brush::Theme(_)) => None,
10432 },
10433 );
10434 visit(
10435 PropertyId::EllipseStrokeThickness,
10436 match &values.stroke_thickness {
10437 Property::Inherited => None,
10438 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10439 },
10440 );
10441 }
10442 Self::Line(values) => {
10443 visit(
10444 PropertyId::LineStroke,
10445 match &values.stroke {
10446 Property::Set(Brush::Solid(color)) => {
10447 Some(PropertyValueRef::Brush(Brush::Solid(*color)))
10448 }
10449 Property::Inherited | Property::Set(Brush::Theme(_)) => None,
10450 },
10451 );
10452 visit(
10453 PropertyId::LineStrokeThickness,
10454 match &values.stroke_thickness {
10455 Property::Inherited => None,
10456 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10457 },
10458 );
10459 visit(
10460 PropertyId::LineX1,
10461 match &values.x1 {
10462 Property::Inherited => None,
10463 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10464 },
10465 );
10466 visit(
10467 PropertyId::LineY1,
10468 match &values.y1 {
10469 Property::Inherited => None,
10470 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10471 },
10472 );
10473 visit(
10474 PropertyId::LineX2,
10475 match &values.x2 {
10476 Property::Inherited => None,
10477 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10478 },
10479 );
10480 visit(
10481 PropertyId::LineY2,
10482 match &values.y2 {
10483 Property::Inherited => None,
10484 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
10485 },
10486 );
10487 }
10488 Self::SymbolIcon(values) => {
10489 visit(
10490 PropertyId::SymbolIconSymbol,
10491 match &values.symbol {
10492 Property::Inherited => None,
10493 Property::Set(value) => Some(PropertyValueRef::Symbol(*value)),
10494 },
10495 );
10496 }
10497 Self::ImageIcon(values) => {
10498 visit(
10499 PropertyId::ImageIconSource,
10500 match &values.source {
10501 Property::Inherited => None,
10502 Property::Set(ImageValue::Uri(value)) => {
10503 Some(PropertyValueRef::Str(value.as_str()))
10504 }
10505 Property::Set(ImageValue::Encoded(value)) => {
10506 Some(PropertyValueRef::EncodedImage(value))
10507 }
10508 },
10509 );
10510 }
10511 Self::FontIcon(values) => {
10512 visit(
10513 PropertyId::FontIconGlyph,
10514 match &values.glyph {
10515 Property::Inherited => None,
10516 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10517 },
10518 );
10519 }
10520 Self::BitmapIcon(values) => {
10521 visit(
10522 PropertyId::BitmapIconUriSource,
10523 match &values.uri_source {
10524 Property::Inherited => None,
10525 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10526 },
10527 );
10528 visit(
10529 PropertyId::BitmapIconShowAsMonochrome,
10530 match &values.show_as_monochrome {
10531 Property::Inherited => None,
10532 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10533 },
10534 );
10535 }
10536 Self::PathIcon(values) => {
10537 visit(
10538 PropertyId::PathIconData,
10539 match &values.data {
10540 Property::Inherited => None,
10541 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10542 },
10543 );
10544 }
10545 Self::ListBoxItem(values) => {
10546 visit(
10547 PropertyId::ListBoxItemTag,
10548 match &values.tag {
10549 Property::Inherited => None,
10550 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10551 },
10552 );
10553 visit(
10554 PropertyId::ListBoxItemIsSelected,
10555 match &values.is_selected {
10556 Property::Inherited => None,
10557 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10558 },
10559 );
10560 }
10561 Self::RatingControl(values) => {
10562 visit(
10563 PropertyId::RatingControlMaxRating,
10564 match &values.max_rating {
10565 Property::Inherited => None,
10566 Property::Set(value) => Some(PropertyValueRef::I32(*value)),
10567 },
10568 );
10569 visit(
10570 PropertyId::RatingControlValue,
10571 match &values.value {
10572 Property::Inherited => None,
10573 Property::Set(value) => Some(PropertyValueRef::OptionalF64(*value)),
10574 },
10575 );
10576 visit(
10577 PropertyId::RatingControlCaption,
10578 match &values.caption {
10579 Property::Inherited => None,
10580 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10581 },
10582 );
10583 visit(
10584 PropertyId::RatingControlIsReadOnly,
10585 match &values.is_read_only {
10586 Property::Inherited => None,
10587 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10588 },
10589 );
10590 }
10591 Self::Expander(values) => {
10592 visit(
10593 PropertyId::ExpanderIsExpanded,
10594 match &values.is_expanded {
10595 Property::Inherited => None,
10596 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10597 },
10598 );
10599 }
10600 Self::ComboBox(values) => {
10601 visit(
10602 PropertyId::ComboBoxItemsSource,
10603 match &values.items_source {
10604 Property::Inherited => None,
10605 Property::Set(value) => Some(PropertyValueRef::StrList(value)),
10606 },
10607 );
10608 visit(
10609 PropertyId::ComboBoxSelectedIndex,
10610 match &values.selected_index {
10611 Property::Inherited => None,
10612 Property::Set(value) => Some(PropertyValueRef::SelectionIndex(*value)),
10613 },
10614 );
10615 visit(
10616 PropertyId::ComboBoxPlaceholderText,
10617 match &values.placeholder_text {
10618 Property::Inherited => None,
10619 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10620 },
10621 );
10622 visit(
10623 PropertyId::ComboBoxIsEditable,
10624 match &values.is_editable {
10625 Property::Inherited => None,
10626 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10627 },
10628 );
10629 visit(
10630 PropertyId::ComboBoxIsEnabled,
10631 match &values.is_enabled {
10632 Property::Inherited => None,
10633 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10634 },
10635 );
10636 }
10637 Self::Pivot(values) => {
10638 visit(
10639 PropertyId::PivotSelectedIndex,
10640 match &values.selected_index {
10641 Property::Inherited => None,
10642 Property::Set(value) => Some(PropertyValueRef::SelectionIndex(*value)),
10643 },
10644 );
10645 visit(
10646 PropertyId::PivotTitle,
10647 match &values.title {
10648 Property::Inherited => None,
10649 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10650 },
10651 );
10652 }
10653 Self::PivotItem(values) => {
10654 visit(
10655 PropertyId::PivotItemHeader,
10656 match &values.header {
10657 Property::Inherited => None,
10658 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10659 },
10660 );
10661 }
10662 Self::FlipView(values) => {
10663 visit(
10664 PropertyId::FlipViewSelectedIndex,
10665 match &values.selected_index {
10666 Property::Inherited => None,
10667 Property::Set(value) => Some(PropertyValueRef::SelectionIndex(*value)),
10668 },
10669 );
10670 }
10671 Self::SelectorBar(_) => {}
10672 Self::SelectorBarItem(values) => {
10673 visit(
10674 PropertyId::SelectorBarItemText,
10675 match &values.text {
10676 Property::Inherited => None,
10677 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10678 },
10679 );
10680 visit(
10681 PropertyId::SelectorBarItemIsSelected,
10682 match &values.is_selected {
10683 Property::Inherited => None,
10684 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10685 },
10686 );
10687 }
10688 Self::TabView(values) => {
10689 visit(
10690 PropertyId::TabViewSelectedIndex,
10691 match &values.selected_index {
10692 Property::Inherited => None,
10693 Property::Set(value) => Some(PropertyValueRef::SelectionIndex(*value)),
10694 },
10695 );
10696 visit(
10697 PropertyId::TabViewCanReorderTabs,
10698 match &values.can_reorder_tabs {
10699 Property::Inherited => None,
10700 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10701 },
10702 );
10703 visit(
10704 PropertyId::TabViewIsAddTabButtonVisible,
10705 match &values.is_add_tab_button_visible {
10706 Property::Inherited => None,
10707 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10708 },
10709 );
10710 }
10711 Self::TabViewItem(values) => {
10712 visit(
10713 PropertyId::TabViewItemHeader,
10714 match &values.header {
10715 Property::Inherited => None,
10716 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10717 },
10718 );
10719 visit(
10720 PropertyId::TabViewItemIsClosable,
10721 match &values.is_closable {
10722 Property::Inherited => None,
10723 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10724 },
10725 );
10726 visit(
10727 PropertyId::TabViewItemTag,
10728 match &values.tag {
10729 Property::Inherited => None,
10730 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10731 },
10732 );
10733 }
10734 Self::TeachingTip(values) => {
10735 visit(
10736 PropertyId::TeachingTipTitle,
10737 match &values.title {
10738 Property::Inherited => None,
10739 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10740 },
10741 );
10742 visit(
10743 PropertyId::TeachingTipSubtitle,
10744 match &values.subtitle {
10745 Property::Inherited => None,
10746 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10747 },
10748 );
10749 visit(
10750 PropertyId::TeachingTipIsOpen,
10751 match &values.is_open {
10752 Property::Inherited => None,
10753 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10754 },
10755 );
10756 visit(
10757 PropertyId::TeachingTipIsLightDismissEnabled,
10758 match &values.is_light_dismiss_enabled {
10759 Property::Inherited => None,
10760 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10761 },
10762 );
10763 visit(
10764 PropertyId::TeachingTipPreferredPlacement,
10765 match &values.preferred_placement {
10766 Property::Inherited => None,
10767 Property::Set(value) => {
10768 Some(PropertyValueRef::TeachingTipPlacementMode(*value))
10769 }
10770 },
10771 );
10772 visit(
10773 PropertyId::TeachingTipActionButtonContent,
10774 match &values.action_button_content {
10775 Property::Inherited => None,
10776 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10777 },
10778 );
10779 visit(
10780 PropertyId::TeachingTipCloseButtonContent,
10781 match &values.close_button_content {
10782 Property::Inherited => None,
10783 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10784 },
10785 );
10786 }
10787 Self::DropDownButton(values) => {
10788 visit(
10789 PropertyId::DropDownButtonIsEnabled,
10790 match &values.is_enabled {
10791 Property::Inherited => None,
10792 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10793 },
10794 );
10795 }
10796 Self::CommandBar(_) => {}
10797 Self::AppBarButton(values) => {
10798 visit(
10799 PropertyId::AppBarButtonLabel,
10800 match &values.label {
10801 Property::Inherited => None,
10802 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10803 },
10804 );
10805 visit(
10806 PropertyId::AppBarButtonIsEnabled,
10807 match &values.is_enabled {
10808 Property::Inherited => None,
10809 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10810 },
10811 );
10812 }
10813 Self::AppBarSeparator(_) => {}
10814 Self::MenuBar(_) => {}
10815 Self::MenuBarItem(values) => {
10816 visit(
10817 PropertyId::MenuBarItemTitle,
10818 match &values.title {
10819 Property::Inherited => None,
10820 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10821 },
10822 );
10823 }
10824 Self::SplitButton(values) => {
10825 visit(
10826 PropertyId::SplitButtonIsEnabled,
10827 match &values.is_enabled {
10828 Property::Inherited => None,
10829 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10830 },
10831 );
10832 }
10833 Self::ColorPicker(values) => {
10834 visit(
10835 PropertyId::ColorPickerColor,
10836 match &values.color {
10837 Property::Inherited => None,
10838 Property::Set(value) => Some(PropertyValueRef::Color(*value)),
10839 },
10840 );
10841 visit(
10842 PropertyId::ColorPickerIsAlphaEnabled,
10843 match &values.is_alpha_enabled {
10844 Property::Inherited => None,
10845 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10846 },
10847 );
10848 visit(
10849 PropertyId::ColorPickerIsHexInputVisible,
10850 match &values.is_hex_input_visible {
10851 Property::Inherited => None,
10852 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10853 },
10854 );
10855 visit(
10856 PropertyId::ColorPickerIsColorSliderVisible,
10857 match &values.is_color_slider_visible {
10858 Property::Inherited => None,
10859 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10860 },
10861 );
10862 visit(
10863 PropertyId::ColorPickerIsColorChannelTextInputVisible,
10864 match &values.is_color_channel_text_input_visible {
10865 Property::Inherited => None,
10866 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10867 },
10868 );
10869 visit(
10870 PropertyId::ColorPickerIsEnabled,
10871 match &values.is_enabled {
10872 Property::Inherited => None,
10873 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10874 },
10875 );
10876 }
10877 Self::DatePicker(values) => {
10878 visit(
10879 PropertyId::DatePickerDayVisible,
10880 match &values.day_visible {
10881 Property::Inherited => None,
10882 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10883 },
10884 );
10885 visit(
10886 PropertyId::DatePickerMonthVisible,
10887 match &values.month_visible {
10888 Property::Inherited => None,
10889 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10890 },
10891 );
10892 visit(
10893 PropertyId::DatePickerYearVisible,
10894 match &values.year_visible {
10895 Property::Inherited => None,
10896 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10897 },
10898 );
10899 visit(
10900 PropertyId::DatePickerIsEnabled,
10901 match &values.is_enabled {
10902 Property::Inherited => None,
10903 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10904 },
10905 );
10906 }
10907 Self::TimePicker(values) => {
10908 visit(
10909 PropertyId::TimePickerClockIdentifier,
10910 match &values.clock_identifier {
10911 Property::Inherited => None,
10912 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10913 },
10914 );
10915 visit(
10916 PropertyId::TimePickerMinuteIncrement,
10917 match &values.minute_increment {
10918 Property::Inherited => None,
10919 Property::Set(value) => Some(PropertyValueRef::I32(*value)),
10920 },
10921 );
10922 visit(
10923 PropertyId::TimePickerIsEnabled,
10924 match &values.is_enabled {
10925 Property::Inherited => None,
10926 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10927 },
10928 );
10929 }
10930 Self::CalendarDatePicker(values) => {
10931 visit(
10932 PropertyId::CalendarDatePickerPlaceholderText,
10933 match &values.placeholder_text {
10934 Property::Inherited => None,
10935 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10936 },
10937 );
10938 visit(
10939 PropertyId::CalendarDatePickerIsTodayHighlighted,
10940 match &values.is_today_highlighted {
10941 Property::Inherited => None,
10942 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10943 },
10944 );
10945 visit(
10946 PropertyId::CalendarDatePickerIsCalendarOpen,
10947 match &values.is_calendar_open {
10948 Property::Inherited => None,
10949 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10950 },
10951 );
10952 visit(
10953 PropertyId::CalendarDatePickerIsEnabled,
10954 match &values.is_enabled {
10955 Property::Inherited => None,
10956 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10957 },
10958 );
10959 }
10960 Self::ToolTip(_) => {}
10961 Self::ContentDialog(values) => {
10962 visit(
10963 PropertyId::ContentDialogTitle,
10964 match &values.title {
10965 Property::Inherited => None,
10966 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10967 },
10968 );
10969 visit(
10970 PropertyId::ContentDialogPrimaryButtonText,
10971 match &values.primary_button_text {
10972 Property::Inherited => None,
10973 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10974 },
10975 );
10976 visit(
10977 PropertyId::ContentDialogSecondaryButtonText,
10978 match &values.secondary_button_text {
10979 Property::Inherited => None,
10980 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10981 },
10982 );
10983 visit(
10984 PropertyId::ContentDialogCloseButtonText,
10985 match &values.close_button_text {
10986 Property::Inherited => None,
10987 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
10988 },
10989 );
10990 visit(
10991 PropertyId::ContentDialogIsPrimaryButtonEnabled,
10992 match &values.is_primary_button_enabled {
10993 Property::Inherited => None,
10994 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
10995 },
10996 );
10997 visit(
10998 PropertyId::ContentDialogIsSecondaryButtonEnabled,
10999 match &values.is_secondary_button_enabled {
11000 Property::Inherited => None,
11001 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11002 },
11003 );
11004 }
11005 Self::CalendarView(values) => {
11006 visit(
11007 PropertyId::CalendarViewIsTodayHighlighted,
11008 match &values.is_today_highlighted {
11009 Property::Inherited => None,
11010 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11011 },
11012 );
11013 visit(
11014 PropertyId::CalendarViewIsGroupLabelVisible,
11015 match &values.is_group_label_visible {
11016 Property::Inherited => None,
11017 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11018 },
11019 );
11020 visit(
11021 PropertyId::CalendarViewIsEnabled,
11022 match &values.is_enabled {
11023 Property::Inherited => None,
11024 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11025 },
11026 );
11027 }
11028 Self::ListView(values) => {
11029 visit(
11030 PropertyId::ListViewSelectedIndex,
11031 match &values.selected_index {
11032 Property::Inherited => None,
11033 Property::Set(value) => Some(PropertyValueRef::SelectionIndex(*value)),
11034 },
11035 );
11036 visit(
11037 PropertyId::ListViewSelectionMode,
11038 match &values.selection_mode {
11039 Property::Inherited => None,
11040 Property::Set(value) => {
11041 Some(PropertyValueRef::ListViewSelectionMode(*value))
11042 }
11043 },
11044 );
11045 visit(
11046 PropertyId::ListViewCanDragItems,
11047 match &values.can_drag_items {
11048 Property::Inherited => None,
11049 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11050 },
11051 );
11052 visit(
11053 PropertyId::ListViewCanReorderItems,
11054 match &values.can_reorder_items {
11055 Property::Inherited => None,
11056 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11057 },
11058 );
11059 visit(
11060 PropertyId::ListViewAllowDrop,
11061 match &values.allow_drop {
11062 Property::Inherited => None,
11063 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11064 },
11065 );
11066 }
11067 Self::ListViewItem(values) => {
11068 visit(
11069 PropertyId::ListViewItemTag,
11070 match &values.tag {
11071 Property::Inherited => None,
11072 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
11073 },
11074 );
11075 }
11076 Self::TreeView(values) => {
11077 visit(
11078 PropertyId::TreeViewSelectionMode,
11079 match &values.selection_mode {
11080 Property::Inherited => None,
11081 Property::Set(value) => {
11082 Some(PropertyValueRef::TreeViewSelectionMode(*value))
11083 }
11084 },
11085 );
11086 }
11087 Self::GridView(values) => {
11088 visit(
11089 PropertyId::GridViewSelectedIndex,
11090 match &values.selected_index {
11091 Property::Inherited => None,
11092 Property::Set(value) => Some(PropertyValueRef::SelectionIndex(*value)),
11093 },
11094 );
11095 visit(
11096 PropertyId::GridViewCanDragItems,
11097 match &values.can_drag_items {
11098 Property::Inherited => None,
11099 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11100 },
11101 );
11102 visit(
11103 PropertyId::GridViewCanReorderItems,
11104 match &values.can_reorder_items {
11105 Property::Inherited => None,
11106 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11107 },
11108 );
11109 visit(
11110 PropertyId::GridViewAllowDrop,
11111 match &values.allow_drop {
11112 Property::Inherited => None,
11113 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11114 },
11115 );
11116 }
11117 Self::GridViewItem(values) => {
11118 visit(
11119 PropertyId::GridViewItemTag,
11120 match &values.tag {
11121 Property::Inherited => None,
11122 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
11123 },
11124 );
11125 }
11126 Self::RelativePanel(_) => {}
11127 Self::Canvas(_) => {}
11128 Self::RichEditBox(values) => {
11129 visit(
11130 PropertyId::RichEditBoxDocument,
11131 match &values.text {
11132 Property::Inherited => None,
11133 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
11134 },
11135 );
11136 visit(
11137 PropertyId::RichEditBoxPlaceholderText,
11138 match &values.placeholder_text {
11139 Property::Inherited => None,
11140 Property::Set(value) => Some(PropertyValueRef::Str(value.as_str())),
11141 },
11142 );
11143 visit(
11144 PropertyId::RichEditBoxIsReadOnly,
11145 match &values.is_read_only {
11146 Property::Inherited => None,
11147 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11148 },
11149 );
11150 visit(
11151 PropertyId::RichEditBoxIsEnabled,
11152 match &values.is_enabled {
11153 Property::Inherited => None,
11154 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11155 },
11156 );
11157 }
11158 Self::RichTextBlock(values) => {
11159 visit(
11160 PropertyId::RichTextBlockBlocks,
11161 match &values.paragraphs {
11162 Property::Inherited => None,
11163 Property::Set(value) => Some(PropertyValueRef::RichText(value)),
11164 },
11165 );
11166 visit(
11167 PropertyId::RichTextBlockFontSize,
11168 match &values.font_size {
11169 Property::Inherited => None,
11170 Property::Set(value) => Some(PropertyValueRef::F64(*value)),
11171 },
11172 );
11173 visit(
11174 PropertyId::RichTextBlockIsTextSelectionEnabled,
11175 match &values.is_text_selection_enabled {
11176 Property::Inherited => None,
11177 Property::Set(value) => Some(PropertyValueRef::Bool(*value)),
11178 },
11179 );
11180 visit(
11181 PropertyId::RichTextBlockTextWrapping,
11182 match &values.text_wrapping {
11183 Property::Inherited => None,
11184 Property::Set(value) => Some(PropertyValueRef::TextWrapping(*value)),
11185 },
11186 );
11187 }
11188 Self::Viewbox(values) => {
11189 visit(
11190 PropertyId::ViewboxStretch,
11191 match &values.stretch {
11192 Property::Inherited => None,
11193 Property::Set(value) => Some(PropertyValueRef::Stretch(*value)),
11194 },
11195 );
11196 }
11197 Self::WebView2(_) => {}
11198 Self::SwapChainPanel(_) => {}
11199 }
11200 }
11201 fn theme_style(&self) -> ThemeStyle {
11202 match self {
11203 Self::TextBlock(values) => ThemeStyle::new([
11204 values.foreground.as_set().copied().and_then(Brush::theme),
11205 None,
11206 None,
11207 None,
11208 ]),
11209 Self::Button(_) => ThemeStyle::default(),
11210 Self::HyperlinkButton(_) => ThemeStyle::default(),
11211 Self::RepeatButton(_) => ThemeStyle::default(),
11212 Self::Border(values) => ThemeStyle::new([
11213 values.background.as_set().copied().and_then(Brush::theme),
11214 values.border_brush.as_set().copied().and_then(Brush::theme),
11215 None,
11216 None,
11217 ]),
11218 Self::BreadcrumbBar(_) => ThemeStyle::default(),
11219 Self::StackPanel(_) => ThemeStyle::default(),
11220 Self::VariableSizedWrapGrid(_) => ThemeStyle::default(),
11221 Self::Grid(values) => ThemeStyle::new([
11222 values.background.as_set().copied().and_then(Brush::theme),
11223 None,
11224 None,
11225 None,
11226 ]),
11227 Self::TextBox(values) => ThemeStyle::new([
11228 values.background.as_set().copied().and_then(Brush::theme),
11229 values.border_brush.as_set().copied().and_then(Brush::theme),
11230 None,
11231 None,
11232 ]),
11233 Self::AutoSuggestBox(_) => ThemeStyle::default(),
11234 Self::PasswordBox(_) => ThemeStyle::default(),
11235 Self::NumberBox(_) => ThemeStyle::default(),
11236 Self::Slider(_) => ThemeStyle::default(),
11237 Self::TitleBar(_) => ThemeStyle::default(),
11238 Self::NavigationView(_) => ThemeStyle::default(),
11239 Self::NavigationViewItem(_) => ThemeStyle::default(),
11240 Self::SplitView(_) => ThemeStyle::default(),
11241 Self::ProgressBar(_) => ThemeStyle::default(),
11242 Self::ToggleSwitch(_) => ThemeStyle::default(),
11243 Self::CheckBox(_) => ThemeStyle::default(),
11244 Self::ToggleButton(_) => ThemeStyle::default(),
11245 Self::RadioButton(_) => ThemeStyle::default(),
11246 Self::RadioButtons(_) => ThemeStyle::default(),
11247 Self::ItemsRepeater(_) => ThemeStyle::default(),
11248 Self::InfoBadge(_) => ThemeStyle::default(),
11249 Self::InfoBar(_) => ThemeStyle::default(),
11250 Self::PersonPicture(_) => ThemeStyle::default(),
11251 Self::ScrollViewer(_) => ThemeStyle::default(),
11252 Self::ScrollView(_) => ThemeStyle::default(),
11253 Self::Image(_) => ThemeStyle::default(),
11254 Self::ProgressRing(_) => ThemeStyle::default(),
11255 Self::ListBox(_) => ThemeStyle::default(),
11256 Self::Rectangle(values) => ThemeStyle::new([
11257 values.fill.as_set().copied().and_then(Brush::theme),
11258 values.stroke.as_set().copied().and_then(Brush::theme),
11259 None,
11260 None,
11261 ]),
11262 Self::Ellipse(values) => ThemeStyle::new([
11263 values.fill.as_set().copied().and_then(Brush::theme),
11264 values.stroke.as_set().copied().and_then(Brush::theme),
11265 None,
11266 None,
11267 ]),
11268 Self::Line(values) => ThemeStyle::new([
11269 values.stroke.as_set().copied().and_then(Brush::theme),
11270 None,
11271 None,
11272 None,
11273 ]),
11274 Self::SymbolIcon(_) => ThemeStyle::default(),
11275 Self::ImageIcon(_) => ThemeStyle::default(),
11276 Self::FontIcon(_) => ThemeStyle::default(),
11277 Self::BitmapIcon(_) => ThemeStyle::default(),
11278 Self::PathIcon(_) => ThemeStyle::default(),
11279 Self::ListBoxItem(_) => ThemeStyle::default(),
11280 Self::RatingControl(_) => ThemeStyle::default(),
11281 Self::Expander(_) => ThemeStyle::default(),
11282 Self::ComboBox(_) => ThemeStyle::default(),
11283 Self::Pivot(_) => ThemeStyle::default(),
11284 Self::PivotItem(_) => ThemeStyle::default(),
11285 Self::FlipView(_) => ThemeStyle::default(),
11286 Self::SelectorBar(_) => ThemeStyle::default(),
11287 Self::SelectorBarItem(_) => ThemeStyle::default(),
11288 Self::TabView(_) => ThemeStyle::default(),
11289 Self::TabViewItem(_) => ThemeStyle::default(),
11290 Self::TeachingTip(_) => ThemeStyle::default(),
11291 Self::DropDownButton(_) => ThemeStyle::default(),
11292 Self::CommandBar(_) => ThemeStyle::default(),
11293 Self::AppBarButton(_) => ThemeStyle::default(),
11294 Self::AppBarSeparator(_) => ThemeStyle::default(),
11295 Self::MenuBar(_) => ThemeStyle::default(),
11296 Self::MenuBarItem(_) => ThemeStyle::default(),
11297 Self::SplitButton(_) => ThemeStyle::default(),
11298 Self::ColorPicker(_) => ThemeStyle::default(),
11299 Self::DatePicker(_) => ThemeStyle::default(),
11300 Self::TimePicker(_) => ThemeStyle::default(),
11301 Self::CalendarDatePicker(_) => ThemeStyle::default(),
11302 Self::ToolTip(_) => ThemeStyle::default(),
11303 Self::ContentDialog(_) => ThemeStyle::default(),
11304 Self::CalendarView(_) => ThemeStyle::default(),
11305 Self::ListView(_) => ThemeStyle::default(),
11306 Self::ListViewItem(_) => ThemeStyle::default(),
11307 Self::TreeView(_) => ThemeStyle::default(),
11308 Self::GridView(_) => ThemeStyle::default(),
11309 Self::GridViewItem(_) => ThemeStyle::default(),
11310 Self::RelativePanel(_) => ThemeStyle::default(),
11311 Self::Canvas(_) => ThemeStyle::default(),
11312 Self::RichEditBox(_) => ThemeStyle::default(),
11313 Self::RichTextBlock(_) => ThemeStyle::default(),
11314 Self::Viewbox(_) => ThemeStyle::default(),
11315 Self::WebView2(_) => ThemeStyle::default(),
11316 Self::SwapChainPanel(_) => ThemeStyle::default(),
11317 }
11318 }
11319}
11320impl MountedEventsExt for MountedProps {
11321 fn visit_events(&self, visit: &mut dyn FnMut(EventId, bool)) {
11322 match self {
11323 Self::TextBlock(_) => {}
11324 Self::Button(values) => {
11325 visit(EventId::ButtonClick, values.on_click.is_some());
11326 }
11327 Self::HyperlinkButton(values) => {
11328 visit(EventId::HyperlinkButtonClick, values.on_click.is_some());
11329 }
11330 Self::RepeatButton(values) => {
11331 visit(EventId::RepeatButtonClick, values.on_click.is_some());
11332 }
11333 Self::Border(values) => {
11334 visit(
11335 EventId::BorderDragEnter,
11336 values
11337 .events
11338 .as_ref()
11339 .is_some_and(|events| events.on_drag_enter.is_some())
11340 || !matches!(values.drop_policy, Property::Inherited),
11341 );
11342 visit(
11343 EventId::BorderDragOver,
11344 values
11345 .events
11346 .as_ref()
11347 .is_some_and(|events| events.on_drag_over.is_some())
11348 || !matches!(values.drop_policy, Property::Inherited),
11349 );
11350 visit(
11351 EventId::BorderDragLeave,
11352 values
11353 .events
11354 .as_ref()
11355 .is_some_and(|events| events.on_drag_leave.is_some()),
11356 );
11357 visit(
11358 EventId::BorderDrop,
11359 values
11360 .events
11361 .as_ref()
11362 .is_some_and(|events| events.on_drop.is_some()),
11363 );
11364 visit(
11365 EventId::BorderPointerPressed,
11366 values
11367 .events
11368 .as_ref()
11369 .is_some_and(|events| events.on_pointer_pressed.is_some())
11370 || !matches!(values.capture_pointer_on_press, Property::Inherited),
11371 );
11372 visit(
11373 EventId::BorderPointerMoved,
11374 values
11375 .events
11376 .as_ref()
11377 .is_some_and(|events| events.on_pointer_moved.is_some()),
11378 );
11379 visit(
11380 EventId::BorderPointerEntered,
11381 values
11382 .events
11383 .as_ref()
11384 .is_some_and(|events| events.on_pointer_entered.is_some()),
11385 );
11386 visit(
11387 EventId::BorderPointerExited,
11388 values
11389 .events
11390 .as_ref()
11391 .is_some_and(|events| events.on_pointer_exited.is_some()),
11392 );
11393 visit(
11394 EventId::BorderPointerReleased,
11395 values
11396 .events
11397 .as_ref()
11398 .is_some_and(|events| events.on_pointer_released.is_some()),
11399 );
11400 visit(
11401 EventId::BorderPointerCaptureLost,
11402 values
11403 .events
11404 .as_ref()
11405 .is_some_and(|events| events.on_pointer_capture_lost.is_some()),
11406 );
11407 visit(
11408 EventId::BorderPointerCanceled,
11409 values
11410 .events
11411 .as_ref()
11412 .is_some_and(|events| events.on_pointer_canceled.is_some()),
11413 );
11414 }
11415 Self::BreadcrumbBar(values) => {
11416 visit(
11417 EventId::BreadcrumbBarItemClicked,
11418 values.on_item_clicked.is_some(),
11419 );
11420 }
11421 Self::StackPanel(_) => {}
11422 Self::VariableSizedWrapGrid(_) => {}
11423 Self::Grid(_) => {}
11424 Self::TextBox(_) => {
11425 visit(EventId::TextBoxTextChanged, true);
11426 }
11427 Self::AutoSuggestBox(values) => {
11428 visit(EventId::AutoSuggestBoxTextChanged, true);
11429 visit(
11430 EventId::AutoSuggestBoxSuggestionChosen,
11431 values
11432 .events
11433 .as_ref()
11434 .is_some_and(|events| events.on_suggestion_chosen.is_some()),
11435 );
11436 }
11437 Self::PasswordBox(_) => {
11438 visit(EventId::PasswordBoxPasswordChanged, true);
11439 }
11440 Self::NumberBox(_) => {
11441 visit(EventId::NumberBoxValueChanged, true);
11442 }
11443 Self::Slider(_) => {
11444 visit(EventId::SliderValueChanged, true);
11445 }
11446 Self::TitleBar(values) => {
11447 visit(
11448 EventId::TitleBarBackRequested,
11449 values
11450 .events
11451 .as_ref()
11452 .is_some_and(|events| events.on_back_requested.is_some()),
11453 );
11454 visit(
11455 EventId::TitleBarPaneToggleRequested,
11456 values
11457 .events
11458 .as_ref()
11459 .is_some_and(|events| events.on_pane_toggle_requested.is_some()),
11460 );
11461 }
11462 Self::NavigationView(values) => {
11463 visit(EventId::NavigationViewIsPaneOpenChanged, true);
11464 visit(
11465 EventId::NavigationViewDisplayModeChanged,
11466 values
11467 .events
11468 .as_ref()
11469 .is_some_and(|events| events.on_display_mode_changed.is_some()),
11470 );
11471 visit(EventId::NavigationViewSelectionChanged, true);
11472 }
11473 Self::NavigationViewItem(_) => {}
11474 Self::SplitView(_) => {
11475 visit(EventId::SplitViewPaneClosed, true);
11476 }
11477 Self::ProgressBar(_) => {}
11478 Self::ToggleSwitch(_) => {
11479 visit(EventId::ToggleSwitchToggled, true);
11480 }
11481 Self::CheckBox(_) => {
11482 visit(EventId::CheckBoxIsCheckedChanged, true);
11483 }
11484 Self::ToggleButton(_) => {
11485 visit(EventId::ToggleButtonIsCheckedChanged, true);
11486 }
11487 Self::RadioButton(_) => {
11488 visit(EventId::RadioButtonChecked, true);
11489 }
11490 Self::RadioButtons(_) => {
11491 visit(EventId::RadioButtonsSelectionChanged, true);
11492 }
11493 Self::ItemsRepeater(_) => {}
11494 Self::InfoBadge(_) => {}
11495 Self::InfoBar(values) => {
11496 visit(EventId::InfoBarClosed, values.on_closed.is_some());
11497 }
11498 Self::PersonPicture(_) => {}
11499 Self::ScrollViewer(_) => {}
11500 Self::ScrollView(_) => {}
11501 Self::Image(values) => {
11502 visit(
11503 EventId::ImageImageOpened,
11504 values
11505 .events
11506 .as_ref()
11507 .is_some_and(|events| events.on_opened.is_some()),
11508 );
11509 visit(
11510 EventId::ImageImageFailed,
11511 values
11512 .events
11513 .as_ref()
11514 .is_some_and(|events| events.on_failed.is_some()),
11515 );
11516 }
11517 Self::ProgressRing(_) => {}
11518 Self::ListBox(_) => {
11519 visit(EventId::ListBoxSelectionChanged, true);
11520 }
11521 Self::Rectangle(_) => {}
11522 Self::Ellipse(_) => {}
11523 Self::Line(_) => {}
11524 Self::SymbolIcon(_) => {}
11525 Self::ImageIcon(_) => {}
11526 Self::FontIcon(_) => {}
11527 Self::BitmapIcon(_) => {}
11528 Self::PathIcon(_) => {}
11529 Self::ListBoxItem(_) => {}
11530 Self::RatingControl(_) => {
11531 visit(EventId::RatingControlValueChanged, true);
11532 }
11533 Self::Expander(_) => {
11534 visit(EventId::ExpanderIsExpandedChanged, true);
11535 }
11536 Self::ComboBox(_) => {
11537 visit(EventId::ComboBoxSelectionChanged, true);
11538 }
11539 Self::Pivot(_) => {
11540 visit(EventId::PivotSelectionChanged, true);
11541 }
11542 Self::PivotItem(_) => {}
11543 Self::FlipView(_) => {
11544 visit(EventId::FlipViewSelectionChanged, true);
11545 }
11546 Self::SelectorBar(_) => {
11547 visit(EventId::SelectorBarSelectionChanged, true);
11548 }
11549 Self::SelectorBarItem(_) => {}
11550 Self::TabView(values) => {
11551 visit(EventId::TabViewSelectionChanged, true);
11552 visit(
11553 EventId::TabViewTabCloseRequested,
11554 values
11555 .events
11556 .as_ref()
11557 .is_some_and(|events| events.on_close_requested.is_some()),
11558 );
11559 visit(
11560 EventId::TabViewAddTabButtonClick,
11561 values
11562 .events
11563 .as_ref()
11564 .is_some_and(|events| events.on_add_tab_button_click.is_some()),
11565 );
11566 visit(
11567 EventId::TabViewTabItemsChanged,
11568 values
11569 .events
11570 .as_ref()
11571 .is_some_and(|events| events.on_reordered.is_some()),
11572 );
11573 }
11574 Self::TabViewItem(_) => {}
11575 Self::TeachingTip(values) => {
11576 visit(
11577 EventId::TeachingTipClosed,
11578 values
11579 .events
11580 .as_ref()
11581 .is_some_and(|events| events.on_closed.is_some()),
11582 );
11583 visit(
11584 EventId::TeachingTipActionButtonClick,
11585 values
11586 .events
11587 .as_ref()
11588 .is_some_and(|events| events.on_action_button_click.is_some()),
11589 );
11590 }
11591 Self::DropDownButton(values) => {
11592 visit(EventId::DropDownButtonClick, values.on_click.is_some());
11593 }
11594 Self::CommandBar(_) => {}
11595 Self::AppBarButton(values) => {
11596 visit(EventId::AppBarButtonClick, values.on_click.is_some());
11597 }
11598 Self::AppBarSeparator(_) => {}
11599 Self::MenuBar(_) => {}
11600 Self::MenuBarItem(_) => {}
11601 Self::SplitButton(values) => {
11602 visit(EventId::SplitButtonClick, values.on_click.is_some());
11603 }
11604 Self::ColorPicker(_) => {
11605 visit(EventId::ColorPickerColorChanged, true);
11606 }
11607 Self::DatePicker(values) => {
11608 visit(
11609 EventId::DatePickerSelectedDateChanged,
11610 values.on_selected_date_changed.is_some(),
11611 );
11612 }
11613 Self::TimePicker(values) => {
11614 visit(
11615 EventId::TimePickerSelectedTimeChanged,
11616 values.on_selected_time_changed.is_some(),
11617 );
11618 }
11619 Self::CalendarDatePicker(values) => {
11620 visit(
11621 EventId::CalendarDatePickerDateChanged,
11622 values.on_date_changed.is_some(),
11623 );
11624 }
11625 Self::ToolTip(_) => {}
11626 Self::ContentDialog(_) => {
11627 visit(EventId::ContentDialogClosed, true);
11628 }
11629 Self::CalendarView(values) => {
11630 visit(
11631 EventId::CalendarViewSelectedDatesChanged,
11632 values.on_selected_dates_changed.is_some(),
11633 );
11634 }
11635 Self::ListView(values) => {
11636 visit(EventId::ListViewSelectionChanged, true);
11637 visit(
11638 EventId::ListViewDragItemsCompleted,
11639 values
11640 .events
11641 .as_ref()
11642 .is_some_and(|events| events.on_reordered.is_some()),
11643 );
11644 }
11645 Self::ListViewItem(_) => {}
11646 Self::TreeView(values) => {
11647 visit(
11648 EventId::TreeViewItemInvoked,
11649 values.on_item_invoked.is_some(),
11650 );
11651 }
11652 Self::GridView(values) => {
11653 visit(
11654 EventId::GridViewDragItemsCompleted,
11655 values
11656 .events
11657 .as_ref()
11658 .is_some_and(|events| events.on_reordered.is_some()),
11659 );
11660 visit(EventId::GridViewSelectionChanged, true);
11661 }
11662 Self::GridViewItem(_) => {}
11663 Self::RelativePanel(_) => {}
11664 Self::Canvas(_) => {}
11665 Self::RichEditBox(_) => {
11666 visit(EventId::RichEditBoxTextChanged, true);
11667 }
11668 Self::RichTextBlock(_) => {}
11669 Self::Viewbox(_) => {}
11670 Self::WebView2(_) => {}
11671 Self::SwapChainPanel(_) => {}
11672 }
11673 }
11674 fn dispatch_event(&self, event: EventId, payload: &EventPayload) -> Option<bool> {
11675 match (self, event, payload) {
11676 (Self::Button(values), EventId::ButtonClick, EventPayload::Unit) => {
11677 values.on_click.as_ref().map(|callback| callback.call(()))
11678 }
11679 (Self::HyperlinkButton(values), EventId::HyperlinkButtonClick, EventPayload::Unit) => {
11680 values.on_click.as_ref().map(|callback| callback.call(()))
11681 }
11682 (Self::RepeatButton(values), EventId::RepeatButtonClick, EventPayload::Unit) => {
11683 values.on_click.as_ref().map(|callback| callback.call(()))
11684 }
11685 (Self::Border(values), EventId::BorderDragEnter, EventPayload::DragKind(value)) => {
11686 values
11687 .events
11688 .as_ref()
11689 .and_then(|events| events.on_drag_enter.as_ref())
11690 .map(|callback| callback.call(*value))
11691 }
11692 (Self::Border(values), EventId::BorderDragOver, EventPayload::DragKind(value)) => {
11693 values
11694 .events
11695 .as_ref()
11696 .and_then(|events| events.on_drag_over.as_ref())
11697 .map(|callback| callback.call(*value))
11698 }
11699 (Self::Border(values), EventId::BorderDragLeave, EventPayload::Unit) => values
11700 .events
11701 .as_ref()
11702 .and_then(|events| events.on_drag_leave.as_ref())
11703 .map(|callback| callback.call(())),
11704 (Self::Border(values), EventId::BorderDrop, EventPayload::DroppedData(value)) => values
11705 .events
11706 .as_ref()
11707 .and_then(|events| events.on_drop.as_ref())
11708 .map(|callback| callback.call(value.clone())),
11709 (
11710 Self::Border(values),
11711 EventId::BorderPointerPressed,
11712 EventPayload::PointerEventInfo(value),
11713 ) => values
11714 .events
11715 .as_ref()
11716 .and_then(|events| events.on_pointer_pressed.as_ref())
11717 .map(|callback| callback.call(*value)),
11718 (
11719 Self::Border(values),
11720 EventId::BorderPointerMoved,
11721 EventPayload::PointerEventInfo(value),
11722 ) => values
11723 .events
11724 .as_ref()
11725 .and_then(|events| events.on_pointer_moved.as_ref())
11726 .map(|callback| callback.call(*value)),
11727 (
11728 Self::Border(values),
11729 EventId::BorderPointerEntered,
11730 EventPayload::PointerEventInfo(value),
11731 ) => values
11732 .events
11733 .as_ref()
11734 .and_then(|events| events.on_pointer_entered.as_ref())
11735 .map(|callback| callback.call(*value)),
11736 (
11737 Self::Border(values),
11738 EventId::BorderPointerExited,
11739 EventPayload::PointerEventInfo(value),
11740 ) => values
11741 .events
11742 .as_ref()
11743 .and_then(|events| events.on_pointer_exited.as_ref())
11744 .map(|callback| callback.call(*value)),
11745 (
11746 Self::Border(values),
11747 EventId::BorderPointerReleased,
11748 EventPayload::PointerEventInfo(value),
11749 ) => values
11750 .events
11751 .as_ref()
11752 .and_then(|events| events.on_pointer_released.as_ref())
11753 .map(|callback| callback.call(*value)),
11754 (Self::Border(values), EventId::BorderPointerCaptureLost, EventPayload::Unit) => values
11755 .events
11756 .as_ref()
11757 .and_then(|events| events.on_pointer_capture_lost.as_ref())
11758 .map(|callback| callback.call(())),
11759 (Self::Border(values), EventId::BorderPointerCanceled, EventPayload::Unit) => values
11760 .events
11761 .as_ref()
11762 .and_then(|events| events.on_pointer_canceled.as_ref())
11763 .map(|callback| callback.call(())),
11764 (
11765 Self::BreadcrumbBar(values),
11766 EventId::BreadcrumbBarItemClicked,
11767 EventPayload::Str(value),
11768 ) => values
11769 .on_item_clicked
11770 .as_ref()
11771 .map(|callback| callback.call(value.clone())),
11772 (Self::TextBox(values), EventId::TextBoxTextChanged, EventPayload::Str(value)) => {
11773 values
11774 .on_text_changed
11775 .as_ref()
11776 .map(|callback| callback.call(value.clone()))
11777 }
11778 (
11779 Self::AutoSuggestBox(values),
11780 EventId::AutoSuggestBoxTextChanged,
11781 EventPayload::Str(value),
11782 ) => values
11783 .events
11784 .as_ref()
11785 .and_then(|events| events.on_text_changed.as_ref())
11786 .map(|callback| callback.call(value.clone())),
11787 (
11788 Self::AutoSuggestBox(values),
11789 EventId::AutoSuggestBoxSuggestionChosen,
11790 EventPayload::Str(value),
11791 ) => values
11792 .events
11793 .as_ref()
11794 .and_then(|events| events.on_suggestion_chosen.as_ref())
11795 .map(|callback| callback.call(value.clone())),
11796 (
11797 Self::PasswordBox(values),
11798 EventId::PasswordBoxPasswordChanged,
11799 EventPayload::Str(value),
11800 ) => values
11801 .on_password_changed
11802 .as_ref()
11803 .map(|callback| callback.call(value.clone())),
11804 (
11805 Self::NumberBox(values),
11806 EventId::NumberBoxValueChanged,
11807 EventPayload::OptionalF64(value),
11808 ) => values
11809 .on_value_changed
11810 .as_ref()
11811 .map(|callback| callback.call(*value)),
11812 (Self::Slider(values), EventId::SliderValueChanged, EventPayload::F64(value)) => values
11813 .on_value_changed
11814 .as_ref()
11815 .map(|callback| callback.call(*value)),
11816 (Self::TitleBar(values), EventId::TitleBarBackRequested, EventPayload::Unit) => values
11817 .events
11818 .as_ref()
11819 .and_then(|events| events.on_back_requested.as_ref())
11820 .map(|callback| callback.call(())),
11821 (Self::TitleBar(values), EventId::TitleBarPaneToggleRequested, EventPayload::Unit) => {
11822 values
11823 .events
11824 .as_ref()
11825 .and_then(|events| events.on_pane_toggle_requested.as_ref())
11826 .map(|callback| callback.call(()))
11827 }
11828 (
11829 Self::NavigationView(values),
11830 EventId::NavigationViewIsPaneOpenChanged,
11831 EventPayload::Bool(value),
11832 ) => values
11833 .events
11834 .as_ref()
11835 .and_then(|events| events.on_is_pane_open_changed.as_ref())
11836 .map(|callback| callback.call(*value)),
11837 (
11838 Self::NavigationView(values),
11839 EventId::NavigationViewDisplayModeChanged,
11840 EventPayload::NavigationViewDisplayMode(value),
11841 ) => values
11842 .events
11843 .as_ref()
11844 .and_then(|events| events.on_display_mode_changed.as_ref())
11845 .map(|callback| callback.call(*value)),
11846 (
11847 Self::NavigationView(values),
11848 EventId::NavigationViewSelectionChanged,
11849 EventPayload::SelectionChange(value),
11850 ) => values
11851 .events
11852 .as_ref()
11853 .and_then(|events| events.on_selected_tag_changed.as_ref())
11854 .map(|callback| callback.call(value.tag.clone())),
11855 (Self::SplitView(values), EventId::SplitViewPaneClosed, EventPayload::Bool(value)) => {
11856 values
11857 .on_pane_closed
11858 .as_ref()
11859 .map(|callback| callback.call(*value))
11860 }
11861 (
11862 Self::ToggleSwitch(values),
11863 EventId::ToggleSwitchToggled,
11864 EventPayload::Bool(value),
11865 ) => values
11866 .on_toggled
11867 .as_ref()
11868 .map(|callback| callback.call(*value)),
11869 (
11870 Self::CheckBox(values),
11871 EventId::CheckBoxIsCheckedChanged,
11872 EventPayload::Bool(value),
11873 ) => values
11874 .on_is_checked_changed
11875 .as_ref()
11876 .map(|callback| callback.call(*value)),
11877 (
11878 Self::ToggleButton(values),
11879 EventId::ToggleButtonIsCheckedChanged,
11880 EventPayload::Bool(value),
11881 ) => values
11882 .on_is_checked_changed
11883 .as_ref()
11884 .map(|callback| callback.call(*value)),
11885 (Self::RadioButton(values), EventId::RadioButtonChecked, EventPayload::Bool(value)) => {
11886 values
11887 .on_checked
11888 .as_ref()
11889 .map(|callback| callback.call(*value))
11890 }
11891 (
11892 Self::RadioButtons(values),
11893 EventId::RadioButtonsSelectionChanged,
11894 EventPayload::SelectionIndex(value),
11895 ) => values
11896 .on_selection_changed
11897 .as_ref()
11898 .map(|callback| callback.call(*value)),
11899 (Self::InfoBar(values), EventId::InfoBarClosed, EventPayload::Unit) => {
11900 values.on_closed.as_ref().map(|callback| callback.call(()))
11901 }
11902 (Self::Image(values), EventId::ImageImageOpened, EventPayload::Unit) => values
11903 .events
11904 .as_ref()
11905 .and_then(|events| events.on_opened.as_ref())
11906 .map(|callback| callback.call(())),
11907 (Self::Image(values), EventId::ImageImageFailed, EventPayload::Unit) => values
11908 .events
11909 .as_ref()
11910 .and_then(|events| events.on_failed.as_ref())
11911 .map(|callback| callback.call(())),
11912 (
11913 Self::ListBox(values),
11914 EventId::ListBoxSelectionChanged,
11915 EventPayload::SelectionChange(value),
11916 ) => values
11917 .on_selected_tag_changed
11918 .as_ref()
11919 .map(|callback| callback.call(value.tag.clone())),
11920 (
11921 Self::RatingControl(values),
11922 EventId::RatingControlValueChanged,
11923 EventPayload::OptionalF64(value),
11924 ) => values
11925 .on_value_changed
11926 .as_ref()
11927 .map(|callback| callback.call(*value)),
11928 (
11929 Self::Expander(values),
11930 EventId::ExpanderIsExpandedChanged,
11931 EventPayload::Bool(value),
11932 ) => values
11933 .on_is_expanded_changed
11934 .as_ref()
11935 .map(|callback| callback.call(*value)),
11936 (
11937 Self::ComboBox(values),
11938 EventId::ComboBoxSelectionChanged,
11939 EventPayload::SelectionIndex(value),
11940 ) => values
11941 .on_selection_changed
11942 .as_ref()
11943 .map(|callback| callback.call(*value)),
11944 (
11945 Self::Pivot(values),
11946 EventId::PivotSelectionChanged,
11947 EventPayload::SelectionIndex(value),
11948 ) => values
11949 .on_selection_changed
11950 .as_ref()
11951 .map(|callback| callback.call(*value)),
11952 (
11953 Self::FlipView(values),
11954 EventId::FlipViewSelectionChanged,
11955 EventPayload::SelectionIndex(value),
11956 ) => values
11957 .on_selection_changed
11958 .as_ref()
11959 .map(|callback| callback.call(*value)),
11960 (
11961 Self::SelectorBar(values),
11962 EventId::SelectorBarSelectionChanged,
11963 EventPayload::SelectionChange(value),
11964 ) => values
11965 .on_selected_text_changed
11966 .as_ref()
11967 .map(|callback| callback.call(value.tag.clone())),
11968 (
11969 Self::TabView(values),
11970 EventId::TabViewSelectionChanged,
11971 EventPayload::SelectionIndex(value),
11972 ) => values
11973 .events
11974 .as_ref()
11975 .and_then(|events| events.on_selection_changed.as_ref())
11976 .map(|callback| callback.call(*value)),
11977 (
11978 Self::TabView(values),
11979 EventId::TabViewTabCloseRequested,
11980 EventPayload::Str(value),
11981 ) => values
11982 .events
11983 .as_ref()
11984 .and_then(|events| events.on_close_requested.as_ref())
11985 .map(|callback| callback.call(value.clone())),
11986 (Self::TabView(values), EventId::TabViewAddTabButtonClick, EventPayload::Unit) => {
11987 values
11988 .events
11989 .as_ref()
11990 .and_then(|events| events.on_add_tab_button_click.as_ref())
11991 .map(|callback| callback.call(()))
11992 }
11993 (
11994 Self::TabView(values),
11995 EventId::TabViewTabItemsChanged,
11996 EventPayload::StrList(value),
11997 ) => values
11998 .events
11999 .as_ref()
12000 .and_then(|events| events.on_reordered.as_ref())
12001 .map(|callback| callback.call(value.as_ref().clone())),
12002 (Self::TeachingTip(values), EventId::TeachingTipClosed, EventPayload::Unit) => values
12003 .events
12004 .as_ref()
12005 .and_then(|events| events.on_closed.as_ref())
12006 .map(|callback| callback.call(())),
12007 (
12008 Self::TeachingTip(values),
12009 EventId::TeachingTipActionButtonClick,
12010 EventPayload::Unit,
12011 ) => values
12012 .events
12013 .as_ref()
12014 .and_then(|events| events.on_action_button_click.as_ref())
12015 .map(|callback| callback.call(())),
12016 (Self::DropDownButton(values), EventId::DropDownButtonClick, EventPayload::Unit) => {
12017 values.on_click.as_ref().map(|callback| callback.call(()))
12018 }
12019 (Self::AppBarButton(values), EventId::AppBarButtonClick, EventPayload::Unit) => {
12020 values.on_click.as_ref().map(|callback| callback.call(()))
12021 }
12022 (Self::SplitButton(values), EventId::SplitButtonClick, EventPayload::Unit) => {
12023 values.on_click.as_ref().map(|callback| callback.call(()))
12024 }
12025 (
12026 Self::ColorPicker(values),
12027 EventId::ColorPickerColorChanged,
12028 EventPayload::Color(value),
12029 ) => values
12030 .on_color_changed
12031 .as_ref()
12032 .map(|callback| callback.call(*value)),
12033 (
12034 Self::DatePicker(values),
12035 EventId::DatePickerSelectedDateChanged,
12036 EventPayload::OptionalDateTime(value),
12037 ) => values
12038 .on_selected_date_changed
12039 .as_ref()
12040 .map(|callback| callback.call(*value)),
12041 (
12042 Self::TimePicker(values),
12043 EventId::TimePickerSelectedTimeChanged,
12044 EventPayload::OptionalTimeSpan(value),
12045 ) => values
12046 .on_selected_time_changed
12047 .as_ref()
12048 .map(|callback| callback.call(*value)),
12049 (
12050 Self::CalendarDatePicker(values),
12051 EventId::CalendarDatePickerDateChanged,
12052 EventPayload::OptionalDateTime(value),
12053 ) => values
12054 .on_date_changed
12055 .as_ref()
12056 .map(|callback| callback.call(*value)),
12057 (
12058 Self::ContentDialog(values),
12059 EventId::ContentDialogClosed,
12060 EventPayload::ContentDialogResult(value),
12061 ) => values
12062 .on_closed
12063 .as_ref()
12064 .map(|callback| callback.call(*value)),
12065 (
12066 Self::CalendarView(values),
12067 EventId::CalendarViewSelectedDatesChanged,
12068 EventPayload::Unit,
12069 ) => values
12070 .on_selected_dates_changed
12071 .as_ref()
12072 .map(|callback| callback.call(())),
12073 (
12074 Self::ListView(values),
12075 EventId::ListViewSelectionChanged,
12076 EventPayload::SelectionIndex(value),
12077 ) => values
12078 .events
12079 .as_ref()
12080 .and_then(|events| events.on_selection_changed.as_ref())
12081 .map(|callback| callback.call(*value)),
12082 (
12083 Self::ListView(values),
12084 EventId::ListViewDragItemsCompleted,
12085 EventPayload::StrList(value),
12086 ) => values
12087 .events
12088 .as_ref()
12089 .and_then(|events| events.on_reordered.as_ref())
12090 .map(|callback| callback.call(value.as_ref().clone())),
12091 (Self::TreeView(values), EventId::TreeViewItemInvoked, EventPayload::Str(value)) => {
12092 values
12093 .on_item_invoked
12094 .as_ref()
12095 .map(|callback| callback.call(value.clone()))
12096 }
12097 (
12098 Self::GridView(values),
12099 EventId::GridViewDragItemsCompleted,
12100 EventPayload::StrList(value),
12101 ) => values
12102 .events
12103 .as_ref()
12104 .and_then(|events| events.on_reordered.as_ref())
12105 .map(|callback| callback.call(value.as_ref().clone())),
12106 (
12107 Self::GridView(values),
12108 EventId::GridViewSelectionChanged,
12109 EventPayload::SelectionIndex(value),
12110 ) => values
12111 .events
12112 .as_ref()
12113 .and_then(|events| events.on_selection_changed.as_ref())
12114 .map(|callback| callback.call(*value)),
12115 (
12116 Self::RichEditBox(values),
12117 EventId::RichEditBoxTextChanged,
12118 EventPayload::Str(value),
12119 ) => values
12120 .on_text_changed
12121 .as_ref()
12122 .map(|callback| callback.call(value.clone())),
12123 _ => None,
12124 }
12125 }
12126 fn observe_event(
12127 &self,
12128 event: EventId,
12129 payload: &EventPayload,
12130 ) -> Option<(PropertyId, PropertyValue)> {
12131 match (self, event, payload) {
12132 (Self::TextBox(_), EventId::TextBoxTextChanged, EventPayload::Str(value)) => {
12133 Some((PropertyId::TextBoxText, (value.clone()).into()))
12134 }
12135 (
12136 Self::AutoSuggestBox(_),
12137 EventId::AutoSuggestBoxTextChanged,
12138 EventPayload::Str(value),
12139 ) => Some((PropertyId::AutoSuggestBoxText, (value.clone()).into())),
12140 (
12141 Self::PasswordBox(_),
12142 EventId::PasswordBoxPasswordChanged,
12143 EventPayload::Str(value),
12144 ) => Some((PropertyId::PasswordBoxPassword, (value.clone()).into())),
12145 (
12146 Self::NumberBox(_),
12147 EventId::NumberBoxValueChanged,
12148 EventPayload::OptionalF64(value),
12149 ) => Some((PropertyId::NumberBoxValue, (*value).into())),
12150 (Self::Slider(_), EventId::SliderValueChanged, EventPayload::F64(value)) => {
12151 Some((PropertyId::SliderValue, (*value).into()))
12152 }
12153 (
12154 Self::NavigationView(_),
12155 EventId::NavigationViewIsPaneOpenChanged,
12156 EventPayload::Bool(value),
12157 ) => Some((PropertyId::NavigationViewIsPaneOpen, (*value).into())),
12158 (Self::SplitView(_), EventId::SplitViewPaneClosed, EventPayload::Bool(value)) => {
12159 Some((PropertyId::SplitViewIsPaneOpen, (*value).into()))
12160 }
12161 (Self::ToggleSwitch(_), EventId::ToggleSwitchToggled, EventPayload::Bool(value)) => {
12162 Some((PropertyId::ToggleSwitchIsOn, (*value).into()))
12163 }
12164 (Self::CheckBox(_), EventId::CheckBoxIsCheckedChanged, EventPayload::Bool(value)) => {
12165 Some((PropertyId::CheckBoxIsChecked, (*value).into()))
12166 }
12167 (
12168 Self::ToggleButton(_),
12169 EventId::ToggleButtonIsCheckedChanged,
12170 EventPayload::Bool(value),
12171 ) => Some((PropertyId::ToggleButtonIsChecked, (*value).into())),
12172 (Self::RadioButton(_), EventId::RadioButtonChecked, EventPayload::Bool(value)) => {
12173 Some((PropertyId::RadioButtonIsChecked, (*value).into()))
12174 }
12175 (
12176 Self::RadioButtons(_),
12177 EventId::RadioButtonsSelectionChanged,
12178 EventPayload::SelectionIndex(value),
12179 ) => Some((PropertyId::RadioButtonsSelectedIndex, (*value).into())),
12180 (
12181 Self::RatingControl(_),
12182 EventId::RatingControlValueChanged,
12183 EventPayload::OptionalF64(value),
12184 ) => Some((PropertyId::RatingControlValue, (*value).into())),
12185 (Self::Expander(_), EventId::ExpanderIsExpandedChanged, EventPayload::Bool(value)) => {
12186 Some((PropertyId::ExpanderIsExpanded, (*value).into()))
12187 }
12188 (
12189 Self::ComboBox(_),
12190 EventId::ComboBoxSelectionChanged,
12191 EventPayload::SelectionIndex(value),
12192 ) => Some((PropertyId::ComboBoxSelectedIndex, (*value).into())),
12193 (
12194 Self::Pivot(_),
12195 EventId::PivotSelectionChanged,
12196 EventPayload::SelectionIndex(value),
12197 ) => Some((PropertyId::PivotSelectedIndex, (*value).into())),
12198 (
12199 Self::FlipView(_),
12200 EventId::FlipViewSelectionChanged,
12201 EventPayload::SelectionIndex(value),
12202 ) => Some((PropertyId::FlipViewSelectedIndex, (*value).into())),
12203 (
12204 Self::TabView(_),
12205 EventId::TabViewSelectionChanged,
12206 EventPayload::SelectionIndex(value),
12207 ) => Some((PropertyId::TabViewSelectedIndex, (*value).into())),
12208 (
12209 Self::ColorPicker(_),
12210 EventId::ColorPickerColorChanged,
12211 EventPayload::Color(value),
12212 ) => Some((PropertyId::ColorPickerColor, (*value).into())),
12213 (
12214 Self::ListView(_),
12215 EventId::ListViewSelectionChanged,
12216 EventPayload::SelectionIndex(value),
12217 ) => Some((PropertyId::ListViewSelectedIndex, (*value).into())),
12218 (
12219 Self::GridView(_),
12220 EventId::GridViewSelectionChanged,
12221 EventPayload::SelectionIndex(value),
12222 ) => Some((PropertyId::GridViewSelectedIndex, (*value).into())),
12223 (Self::RichEditBox(_), EventId::RichEditBoxTextChanged, EventPayload::Str(value)) => {
12224 Some((PropertyId::RichEditBoxDocument, (value.clone()).into()))
12225 }
12226 _ => None,
12227 }
12228 }
12229}
12230#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12231pub enum MountedKind {
12232 TextBlock,
12233 Button,
12234 HyperlinkButton,
12235 RepeatButton,
12236 Border,
12237 BreadcrumbBar,
12238 StackPanel,
12239 VariableSizedWrapGrid,
12240 Grid,
12241 TextBox,
12242 AutoSuggestBox,
12243 PasswordBox,
12244 NumberBox,
12245 Slider,
12246 TitleBar,
12247 NavigationView,
12248 NavigationViewItem,
12249 SplitView,
12250 ProgressBar,
12251 ToggleSwitch,
12252 CheckBox,
12253 ToggleButton,
12254 RadioButton,
12255 RadioButtons,
12256 ItemsRepeater,
12257 InfoBadge,
12258 InfoBar,
12259 PersonPicture,
12260 ScrollViewer,
12261 ScrollView,
12262 Image,
12263 ProgressRing,
12264 ListBox,
12265 Rectangle,
12266 Ellipse,
12267 Line,
12268 SymbolIcon,
12269 ImageIcon,
12270 FontIcon,
12271 BitmapIcon,
12272 PathIcon,
12273 ListBoxItem,
12274 RatingControl,
12275 Expander,
12276 ComboBox,
12277 Pivot,
12278 PivotItem,
12279 FlipView,
12280 SelectorBar,
12281 SelectorBarItem,
12282 TabView,
12283 TabViewItem,
12284 TeachingTip,
12285 DropDownButton,
12286 CommandBar,
12287 AppBarButton,
12288 AppBarSeparator,
12289 MenuBar,
12290 MenuBarItem,
12291 SplitButton,
12292 ColorPicker,
12293 DatePicker,
12294 TimePicker,
12295 CalendarDatePicker,
12296 ToolTip,
12297 ContentDialog,
12298 CalendarView,
12299 ListView,
12300 ListViewItem,
12301 TreeView,
12302 GridView,
12303 GridViewItem,
12304 RelativePanel,
12305 Canvas,
12306 RichEditBox,
12307 RichTextBlock,
12308 Viewbox,
12309 WebView2,
12310 SwapChainPanel,
12311}
12312#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12313pub enum SlotId {
12314 TextBoxHeader,
12315 AutoSuggestBoxHeader,
12316 PasswordBoxHeader,
12317 NumberBoxHeader,
12318 SliderHeader,
12319 TitleBarContent,
12320 TitleBarRightHeader,
12321 NavigationViewContent,
12322 NavigationViewHeader,
12323 NavigationViewPaneCustomContent,
12324 NavigationViewPaneFooter,
12325 NavigationViewMenuItems,
12326 NavigationViewItemContent,
12327 NavigationViewItemIcon,
12328 NavigationViewItemMenuItems,
12329 SplitViewPane,
12330 SplitViewContent,
12331 ToggleSwitchHeader,
12332 ToggleSwitchOnContent,
12333 ToggleSwitchOffContent,
12334 RadioButtonsHeader,
12335 ListBoxItems,
12336 ExpanderHeader,
12337 ExpanderContent,
12338 ComboBoxHeader,
12339 PivotItems,
12340 FlipViewItems,
12341 SelectorBarItems,
12342 SelectorBarItemIcon,
12343 TabViewTabItems,
12344 CommandBarPrimaryCommands,
12345 CommandBarSecondaryCommands,
12346 AppBarButtonIcon,
12347 MenuBarItems,
12348 DatePickerHeader,
12349 TimePickerHeader,
12350 CalendarDatePickerHeader,
12351 ListViewItems,
12352 GridViewItems,
12353 RichEditBoxHeader,
12354 ViewboxChild,
12355}
12356pub fn slot_id(kind: MountedKind, index: u8) -> Option<SlotId> {
12357 match kind {
12358 MountedKind::TextBox => match index {
12359 0u8 => Some(SlotId::TextBoxHeader),
12360 _ => None,
12361 },
12362 MountedKind::AutoSuggestBox => match index {
12363 0u8 => Some(SlotId::AutoSuggestBoxHeader),
12364 _ => None,
12365 },
12366 MountedKind::PasswordBox => match index {
12367 0u8 => Some(SlotId::PasswordBoxHeader),
12368 _ => None,
12369 },
12370 MountedKind::NumberBox => match index {
12371 0u8 => Some(SlotId::NumberBoxHeader),
12372 _ => None,
12373 },
12374 MountedKind::Slider => match index {
12375 0u8 => Some(SlotId::SliderHeader),
12376 _ => None,
12377 },
12378 MountedKind::TitleBar => match index {
12379 0u8 => Some(SlotId::TitleBarContent),
12380 1u8 => Some(SlotId::TitleBarRightHeader),
12381 _ => None,
12382 },
12383 MountedKind::NavigationView => match index {
12384 0u8 => Some(SlotId::NavigationViewContent),
12385 1u8 => Some(SlotId::NavigationViewHeader),
12386 2u8 => Some(SlotId::NavigationViewPaneCustomContent),
12387 3u8 => Some(SlotId::NavigationViewPaneFooter),
12388 4u8 => Some(SlotId::NavigationViewMenuItems),
12389 _ => None,
12390 },
12391 MountedKind::NavigationViewItem => match index {
12392 0u8 => Some(SlotId::NavigationViewItemContent),
12393 1u8 => Some(SlotId::NavigationViewItemIcon),
12394 2u8 => Some(SlotId::NavigationViewItemMenuItems),
12395 _ => None,
12396 },
12397 MountedKind::SplitView => match index {
12398 0u8 => Some(SlotId::SplitViewPane),
12399 1u8 => Some(SlotId::SplitViewContent),
12400 _ => None,
12401 },
12402 MountedKind::ToggleSwitch => match index {
12403 0u8 => Some(SlotId::ToggleSwitchHeader),
12404 1u8 => Some(SlotId::ToggleSwitchOnContent),
12405 2u8 => Some(SlotId::ToggleSwitchOffContent),
12406 _ => None,
12407 },
12408 MountedKind::RadioButtons => match index {
12409 0u8 => Some(SlotId::RadioButtonsHeader),
12410 _ => None,
12411 },
12412 MountedKind::ListBox => match index {
12413 0u8 => Some(SlotId::ListBoxItems),
12414 _ => None,
12415 },
12416 MountedKind::Expander => match index {
12417 0u8 => Some(SlotId::ExpanderHeader),
12418 1u8 => Some(SlotId::ExpanderContent),
12419 _ => None,
12420 },
12421 MountedKind::ComboBox => match index {
12422 0u8 => Some(SlotId::ComboBoxHeader),
12423 _ => None,
12424 },
12425 MountedKind::Pivot => match index {
12426 0u8 => Some(SlotId::PivotItems),
12427 _ => None,
12428 },
12429 MountedKind::FlipView => match index {
12430 0u8 => Some(SlotId::FlipViewItems),
12431 _ => None,
12432 },
12433 MountedKind::SelectorBar => match index {
12434 0u8 => Some(SlotId::SelectorBarItems),
12435 _ => None,
12436 },
12437 MountedKind::SelectorBarItem => match index {
12438 0u8 => Some(SlotId::SelectorBarItemIcon),
12439 _ => None,
12440 },
12441 MountedKind::TabView => match index {
12442 0u8 => Some(SlotId::TabViewTabItems),
12443 _ => None,
12444 },
12445 MountedKind::CommandBar => match index {
12446 0u8 => Some(SlotId::CommandBarPrimaryCommands),
12447 1u8 => Some(SlotId::CommandBarSecondaryCommands),
12448 _ => None,
12449 },
12450 MountedKind::AppBarButton => match index {
12451 0u8 => Some(SlotId::AppBarButtonIcon),
12452 _ => None,
12453 },
12454 MountedKind::MenuBar => match index {
12455 0u8 => Some(SlotId::MenuBarItems),
12456 _ => None,
12457 },
12458 MountedKind::DatePicker => match index {
12459 0u8 => Some(SlotId::DatePickerHeader),
12460 _ => None,
12461 },
12462 MountedKind::TimePicker => match index {
12463 0u8 => Some(SlotId::TimePickerHeader),
12464 _ => None,
12465 },
12466 MountedKind::CalendarDatePicker => match index {
12467 0u8 => Some(SlotId::CalendarDatePickerHeader),
12468 _ => None,
12469 },
12470 MountedKind::ListView => match index {
12471 0u8 => Some(SlotId::ListViewItems),
12472 _ => None,
12473 },
12474 MountedKind::GridView => match index {
12475 0u8 => Some(SlotId::GridViewItems),
12476 _ => None,
12477 },
12478 MountedKind::RichEditBox => match index {
12479 0u8 => Some(SlotId::RichEditBoxHeader),
12480 _ => None,
12481 },
12482 MountedKind::Viewbox => match index {
12483 0u8 => Some(SlotId::ViewboxChild),
12484 _ => None,
12485 },
12486 _ => None,
12487 }
12488}
12489pub fn slots(kind: MountedKind) -> &'static [SlotId] {
12490 match kind {
12491 MountedKind::TextBlock => &[],
12492 MountedKind::Button => &[],
12493 MountedKind::HyperlinkButton => &[],
12494 MountedKind::RepeatButton => &[],
12495 MountedKind::Border => &[],
12496 MountedKind::BreadcrumbBar => &[],
12497 MountedKind::StackPanel => &[],
12498 MountedKind::VariableSizedWrapGrid => &[],
12499 MountedKind::Grid => &[],
12500 MountedKind::TextBox => &[SlotId::TextBoxHeader],
12501 MountedKind::AutoSuggestBox => &[SlotId::AutoSuggestBoxHeader],
12502 MountedKind::PasswordBox => &[SlotId::PasswordBoxHeader],
12503 MountedKind::NumberBox => &[SlotId::NumberBoxHeader],
12504 MountedKind::Slider => &[SlotId::SliderHeader],
12505 MountedKind::TitleBar => &[SlotId::TitleBarContent, SlotId::TitleBarRightHeader],
12506 MountedKind::NavigationView => &[
12507 SlotId::NavigationViewContent,
12508 SlotId::NavigationViewHeader,
12509 SlotId::NavigationViewPaneCustomContent,
12510 SlotId::NavigationViewPaneFooter,
12511 SlotId::NavigationViewMenuItems,
12512 ],
12513 MountedKind::NavigationViewItem => &[
12514 SlotId::NavigationViewItemContent,
12515 SlotId::NavigationViewItemIcon,
12516 SlotId::NavigationViewItemMenuItems,
12517 ],
12518 MountedKind::SplitView => &[SlotId::SplitViewPane, SlotId::SplitViewContent],
12519 MountedKind::ProgressBar => &[],
12520 MountedKind::ToggleSwitch => &[
12521 SlotId::ToggleSwitchHeader,
12522 SlotId::ToggleSwitchOnContent,
12523 SlotId::ToggleSwitchOffContent,
12524 ],
12525 MountedKind::CheckBox => &[],
12526 MountedKind::ToggleButton => &[],
12527 MountedKind::RadioButton => &[],
12528 MountedKind::RadioButtons => &[SlotId::RadioButtonsHeader],
12529 MountedKind::ItemsRepeater => &[],
12530 MountedKind::InfoBadge => &[],
12531 MountedKind::InfoBar => &[],
12532 MountedKind::PersonPicture => &[],
12533 MountedKind::ScrollViewer => &[],
12534 MountedKind::ScrollView => &[],
12535 MountedKind::Image => &[],
12536 MountedKind::ProgressRing => &[],
12537 MountedKind::ListBox => &[SlotId::ListBoxItems],
12538 MountedKind::Rectangle => &[],
12539 MountedKind::Ellipse => &[],
12540 MountedKind::Line => &[],
12541 MountedKind::SymbolIcon => &[],
12542 MountedKind::ImageIcon => &[],
12543 MountedKind::FontIcon => &[],
12544 MountedKind::BitmapIcon => &[],
12545 MountedKind::PathIcon => &[],
12546 MountedKind::ListBoxItem => &[],
12547 MountedKind::RatingControl => &[],
12548 MountedKind::Expander => &[SlotId::ExpanderHeader, SlotId::ExpanderContent],
12549 MountedKind::ComboBox => &[SlotId::ComboBoxHeader],
12550 MountedKind::Pivot => &[SlotId::PivotItems],
12551 MountedKind::PivotItem => &[],
12552 MountedKind::FlipView => &[SlotId::FlipViewItems],
12553 MountedKind::SelectorBar => &[SlotId::SelectorBarItems],
12554 MountedKind::SelectorBarItem => &[SlotId::SelectorBarItemIcon],
12555 MountedKind::TabView => &[SlotId::TabViewTabItems],
12556 MountedKind::TabViewItem => &[],
12557 MountedKind::TeachingTip => &[],
12558 MountedKind::DropDownButton => &[],
12559 MountedKind::CommandBar => &[
12560 SlotId::CommandBarPrimaryCommands,
12561 SlotId::CommandBarSecondaryCommands,
12562 ],
12563 MountedKind::AppBarButton => &[SlotId::AppBarButtonIcon],
12564 MountedKind::AppBarSeparator => &[],
12565 MountedKind::MenuBar => &[SlotId::MenuBarItems],
12566 MountedKind::MenuBarItem => &[],
12567 MountedKind::SplitButton => &[],
12568 MountedKind::ColorPicker => &[],
12569 MountedKind::DatePicker => &[SlotId::DatePickerHeader],
12570 MountedKind::TimePicker => &[SlotId::TimePickerHeader],
12571 MountedKind::CalendarDatePicker => &[SlotId::CalendarDatePickerHeader],
12572 MountedKind::ToolTip => &[],
12573 MountedKind::ContentDialog => &[],
12574 MountedKind::CalendarView => &[],
12575 MountedKind::ListView => &[SlotId::ListViewItems],
12576 MountedKind::ListViewItem => &[],
12577 MountedKind::TreeView => &[],
12578 MountedKind::GridView => &[SlotId::GridViewItems],
12579 MountedKind::GridViewItem => &[],
12580 MountedKind::RelativePanel => &[],
12581 MountedKind::Canvas => &[],
12582 MountedKind::RichEditBox => &[SlotId::RichEditBoxHeader],
12583 MountedKind::RichTextBlock => &[],
12584 MountedKind::Viewbox => &[SlotId::ViewboxChild],
12585 MountedKind::WebView2 => &[],
12586 MountedKind::SwapChainPanel => &[],
12587 }
12588}
12589pub fn slot_is_collection(slot: SlotId) -> bool {
12590 matches!(
12591 slot,
12592 SlotId::NavigationViewMenuItems
12593 | SlotId::NavigationViewItemMenuItems
12594 | SlotId::ListBoxItems
12595 | SlotId::PivotItems
12596 | SlotId::FlipViewItems
12597 | SlotId::SelectorBarItems
12598 | SlotId::TabViewTabItems
12599 | SlotId::CommandBarPrimaryCommands
12600 | SlotId::CommandBarSecondaryCommands
12601 | SlotId::MenuBarItems
12602 | SlotId::ListViewItems
12603 | SlotId::GridViewItems
12604 )
12605}
12606#[derive(Clone, Debug)]
12607pub(crate) struct TextBlockMountedProps {
12608 text: Property<String>,
12609 text_wrapping: Property<TextWrapping>,
12610 font_size: Property<f64>,
12611 font_weight: Property<FontWeight>,
12612 is_text_selection_enabled: Property<bool>,
12613 max_lines: Property<i32>,
12614 text_trimming: Property<TextTrimming>,
12615 foreground: Property<Brush>,
12616}
12617impl PartialEq for TextBlockMountedProps {
12618 fn eq(&self, other: &Self) -> bool {
12619 true && self.text == other.text
12620 && self.text_wrapping == other.text_wrapping
12621 && f64_property_eq(&self.font_size, &other.font_size)
12622 && self.font_weight == other.font_weight
12623 && self.is_text_selection_enabled == other.is_text_selection_enabled
12624 && self.max_lines == other.max_lines
12625 && self.text_trimming == other.text_trimming
12626 && self.foreground == other.foreground
12627 }
12628}
12629#[derive(Clone, Debug)]
12630pub(crate) struct ButtonMountedProps {
12631 is_enabled: Property<bool>,
12632 horizontal_content_alignment: Property<HorizontalAlignment>,
12633 vertical_content_alignment: Property<VerticalAlignment>,
12634 resource_overrides: Property<ResourceOverrides>,
12635 style: Property<ButtonStyle>,
12636 key_accelerators: Property<KeyAccelerators>,
12637 on_click: Option<Callback<()>>,
12638}
12639impl PartialEq for ButtonMountedProps {
12640 fn eq(&self, other: &Self) -> bool {
12641 true && self.is_enabled == other.is_enabled
12642 && self.horizontal_content_alignment == other.horizontal_content_alignment
12643 && self.vertical_content_alignment == other.vertical_content_alignment
12644 && self.resource_overrides == other.resource_overrides
12645 && self.style == other.style
12646 && self.key_accelerators == other.key_accelerators
12647 && self.on_click == other.on_click
12648 }
12649}
12650#[derive(Clone, Debug)]
12651pub(crate) struct HyperlinkButtonMountedProps {
12652 navigate_uri: Property<String>,
12653 is_enabled: Property<bool>,
12654 on_click: Option<Callback<()>>,
12655}
12656impl PartialEq for HyperlinkButtonMountedProps {
12657 fn eq(&self, other: &Self) -> bool {
12658 true && self.navigate_uri == other.navigate_uri
12659 && self.is_enabled == other.is_enabled
12660 && self.on_click == other.on_click
12661 }
12662}
12663#[derive(Clone, Debug)]
12664pub(crate) struct RepeatButtonMountedProps {
12665 delay: Property<i32>,
12666 interval: Property<i32>,
12667 is_enabled: Property<bool>,
12668 on_click: Option<Callback<()>>,
12669}
12670impl PartialEq for RepeatButtonMountedProps {
12671 fn eq(&self, other: &Self) -> bool {
12672 true && self.delay == other.delay
12673 && self.interval == other.interval
12674 && self.is_enabled == other.is_enabled
12675 && self.on_click == other.on_click
12676 }
12677}
12678#[derive(Clone, Debug)]
12679pub(crate) struct BorderMountedProps {
12680 padding: Property<Thickness>,
12681 border_thickness: Property<Thickness>,
12682 corner_radius: Property<CornerRadius>,
12683 background: Property<Brush>,
12684 border_brush: Property<Brush>,
12685 opacity_transition: Property<std::time::Duration>,
12686 scale: Property<f64>,
12687 scale_transition: Property<std::time::Duration>,
12688 capture_pointer_on_press: Property<bool>,
12689 drop_policy: Property<DragDropPolicy>,
12690 events: Option<std::rc::Rc<BorderEvents>>,
12691}
12692impl PartialEq for BorderMountedProps {
12693 fn eq(&self, other: &Self) -> bool {
12694 true && self.padding == other.padding
12695 && self.border_thickness == other.border_thickness
12696 && self.corner_radius == other.corner_radius
12697 && self.background == other.background
12698 && self.border_brush == other.border_brush
12699 && self.opacity_transition == other.opacity_transition
12700 && f64_property_eq(&self.scale, &other.scale)
12701 && self.scale_transition == other.scale_transition
12702 && self.capture_pointer_on_press == other.capture_pointer_on_press
12703 && self.drop_policy == other.drop_policy
12704 && self.events == other.events
12705 }
12706}
12707#[derive(Clone, Debug)]
12708pub(crate) struct BreadcrumbBarMountedProps {
12709 items_source: Property<std::rc::Rc<Vec<String>>>,
12710 on_item_clicked: Option<Callback<String>>,
12711}
12712impl PartialEq for BreadcrumbBarMountedProps {
12713 fn eq(&self, other: &Self) -> bool {
12714 true && self.items_source == other.items_source
12715 && self.on_item_clicked == other.on_item_clicked
12716 }
12717}
12718#[derive(Clone, Debug)]
12719pub(crate) struct StackPanelMountedProps {
12720 orientation: Property<Orientation>,
12721 spacing: Property<f64>,
12722}
12723impl PartialEq for StackPanelMountedProps {
12724 fn eq(&self, other: &Self) -> bool {
12725 true && self.orientation == other.orientation
12726 && f64_property_eq(&self.spacing, &other.spacing)
12727 }
12728}
12729#[derive(Clone, Debug)]
12730pub(crate) struct VariableSizedWrapGridMountedProps {
12731 item_width: Property<f64>,
12732 item_height: Property<f64>,
12733 orientation: Property<Orientation>,
12734}
12735impl PartialEq for VariableSizedWrapGridMountedProps {
12736 fn eq(&self, other: &Self) -> bool {
12737 true && f64_property_eq(&self.item_width, &other.item_width)
12738 && f64_property_eq(&self.item_height, &other.item_height)
12739 && self.orientation == other.orientation
12740 }
12741}
12742#[derive(Clone, Debug)]
12743pub(crate) struct GridMountedProps {
12744 row_spacing: Property<f64>,
12745 column_spacing: Property<f64>,
12746 key_accelerators: Property<KeyAccelerators>,
12747 background: Property<Brush>,
12748 rows: Property<std::rc::Rc<Vec<GridLength>>>,
12749 columns: Property<std::rc::Rc<Vec<GridLength>>>,
12750}
12751impl PartialEq for GridMountedProps {
12752 fn eq(&self, other: &Self) -> bool {
12753 true && f64_property_eq(&self.row_spacing, &other.row_spacing)
12754 && f64_property_eq(&self.column_spacing, &other.column_spacing)
12755 && self.key_accelerators == other.key_accelerators
12756 && self.background == other.background
12757 && self.rows == other.rows
12758 && self.columns == other.columns
12759 }
12760}
12761#[derive(Clone, Debug)]
12762pub(crate) struct TextBoxMountedProps {
12763 text: Property<String>,
12764 placeholder_text: Property<String>,
12765 is_enabled: Property<bool>,
12766 accepts_return: Property<bool>,
12767 text_wrapping: Property<TextWrapping>,
12768 background: Property<Brush>,
12769 border_brush: Property<Brush>,
12770 border_thickness: Property<Thickness>,
12771 on_text_changed: Option<Callback<String>>,
12772}
12773impl PartialEq for TextBoxMountedProps {
12774 fn eq(&self, other: &Self) -> bool {
12775 true && self.text == other.text
12776 && self.placeholder_text == other.placeholder_text
12777 && self.is_enabled == other.is_enabled
12778 && self.accepts_return == other.accepts_return
12779 && self.text_wrapping == other.text_wrapping
12780 && self.background == other.background
12781 && self.border_brush == other.border_brush
12782 && self.border_thickness == other.border_thickness
12783 && self.on_text_changed == other.on_text_changed
12784 }
12785}
12786#[derive(Clone, Debug)]
12787pub(crate) struct AutoSuggestBoxMountedProps {
12788 text: Property<String>,
12789 items_source: Property<std::rc::Rc<Vec<String>>>,
12790 placeholder_text: Property<String>,
12791 is_enabled: Property<bool>,
12792 events: Option<std::rc::Rc<AutoSuggestBoxEvents>>,
12793}
12794impl PartialEq for AutoSuggestBoxMountedProps {
12795 fn eq(&self, other: &Self) -> bool {
12796 true && self.text == other.text
12797 && self.items_source == other.items_source
12798 && self.placeholder_text == other.placeholder_text
12799 && self.is_enabled == other.is_enabled
12800 && self.events == other.events
12801 }
12802}
12803#[derive(Clone, Debug)]
12804pub(crate) struct PasswordBoxMountedProps {
12805 password: Property<String>,
12806 placeholder_text: Property<String>,
12807 password_reveal_mode: Property<PasswordRevealMode>,
12808 is_enabled: Property<bool>,
12809 on_password_changed: Option<Callback<String>>,
12810}
12811impl PartialEq for PasswordBoxMountedProps {
12812 fn eq(&self, other: &Self) -> bool {
12813 true && self.password == other.password
12814 && self.placeholder_text == other.placeholder_text
12815 && self.password_reveal_mode == other.password_reveal_mode
12816 && self.is_enabled == other.is_enabled
12817 && self.on_password_changed == other.on_password_changed
12818 }
12819}
12820#[derive(Clone, Debug)]
12821pub(crate) struct NumberBoxMountedProps {
12822 minimum: Property<f64>,
12823 maximum: Property<f64>,
12824 value: Property<Option<f64>>,
12825 is_enabled: Property<bool>,
12826 on_value_changed: Option<Callback<Option<f64>>>,
12827}
12828impl PartialEq for NumberBoxMountedProps {
12829 fn eq(&self, other: &Self) -> bool {
12830 true && f64_property_eq(&self.minimum, &other.minimum)
12831 && f64_property_eq(&self.maximum, &other.maximum)
12832 && self.value == other.value
12833 && self.is_enabled == other.is_enabled
12834 && self.on_value_changed == other.on_value_changed
12835 }
12836}
12837#[derive(Clone, Debug)]
12838pub(crate) struct SliderMountedProps {
12839 minimum: Property<f64>,
12840 maximum: Property<f64>,
12841 value: Property<f64>,
12842 is_enabled: Property<bool>,
12843 step_frequency: Property<f64>,
12844 orientation: Property<Orientation>,
12845 on_value_changed: Option<Callback<f64>>,
12846}
12847impl PartialEq for SliderMountedProps {
12848 fn eq(&self, other: &Self) -> bool {
12849 true && f64_property_eq(&self.minimum, &other.minimum)
12850 && f64_property_eq(&self.maximum, &other.maximum)
12851 && f64_property_eq(&self.value, &other.value)
12852 && self.is_enabled == other.is_enabled
12853 && f64_property_eq(&self.step_frequency, &other.step_frequency)
12854 && self.orientation == other.orientation
12855 && self.on_value_changed == other.on_value_changed
12856 }
12857}
12858#[derive(Clone, Debug)]
12859pub(crate) struct TitleBarMountedProps {
12860 title: Property<String>,
12861 subtitle: Property<String>,
12862 is_back_button_visible: Property<bool>,
12863 is_back_button_enabled: Property<bool>,
12864 is_pane_toggle_button_visible: Property<bool>,
12865 events: Option<std::rc::Rc<TitleBarEvents>>,
12866}
12867impl PartialEq for TitleBarMountedProps {
12868 fn eq(&self, other: &Self) -> bool {
12869 true && self.title == other.title
12870 && self.subtitle == other.subtitle
12871 && self.is_back_button_visible == other.is_back_button_visible
12872 && self.is_back_button_enabled == other.is_back_button_enabled
12873 && self.is_pane_toggle_button_visible == other.is_pane_toggle_button_visible
12874 && self.events == other.events
12875 }
12876}
12877#[derive(Clone, Debug)]
12878pub(crate) struct NavigationViewMountedProps {
12879 is_enabled: Property<bool>,
12880 pane_display_mode: Property<NavigationViewPaneDisplayMode>,
12881 is_pane_toggle_button_visible: Property<bool>,
12882 is_back_button_visible: Property<NavigationViewBackButtonVisible>,
12883 is_settings_visible: Property<bool>,
12884 always_show_header: Property<bool>,
12885 pane_title: Property<String>,
12886 open_pane_length: Property<f64>,
12887 is_pane_open: Property<bool>,
12888 events: Option<std::rc::Rc<NavigationViewEvents>>,
12889}
12890impl PartialEq for NavigationViewMountedProps {
12891 fn eq(&self, other: &Self) -> bool {
12892 true && self.is_enabled == other.is_enabled
12893 && self.pane_display_mode == other.pane_display_mode
12894 && self.is_pane_toggle_button_visible == other.is_pane_toggle_button_visible
12895 && self.is_back_button_visible == other.is_back_button_visible
12896 && self.is_settings_visible == other.is_settings_visible
12897 && self.always_show_header == other.always_show_header
12898 && self.pane_title == other.pane_title
12899 && f64_property_eq(&self.open_pane_length, &other.open_pane_length)
12900 && self.is_pane_open == other.is_pane_open
12901 && self.events == other.events
12902 }
12903}
12904#[derive(Clone, Debug)]
12905pub(crate) struct NavigationViewItemMountedProps {
12906 tag: Property<String>,
12907 is_selected: Property<bool>,
12908 selects_on_invoked: Property<bool>,
12909 is_expanded: Property<bool>,
12910}
12911impl PartialEq for NavigationViewItemMountedProps {
12912 fn eq(&self, other: &Self) -> bool {
12913 true && self.tag == other.tag
12914 && self.is_selected == other.is_selected
12915 && self.selects_on_invoked == other.selects_on_invoked
12916 && self.is_expanded == other.is_expanded
12917 }
12918}
12919#[derive(Clone, Debug)]
12920pub(crate) struct SplitViewMountedProps {
12921 open_pane_length: Property<f64>,
12922 compact_pane_length: Property<f64>,
12923 display_mode: Property<SplitViewDisplayMode>,
12924 is_pane_open: Property<bool>,
12925 on_pane_closed: Option<Callback<bool>>,
12926}
12927impl PartialEq for SplitViewMountedProps {
12928 fn eq(&self, other: &Self) -> bool {
12929 true && f64_property_eq(&self.open_pane_length, &other.open_pane_length)
12930 && f64_property_eq(&self.compact_pane_length, &other.compact_pane_length)
12931 && self.display_mode == other.display_mode
12932 && self.is_pane_open == other.is_pane_open
12933 && self.on_pane_closed == other.on_pane_closed
12934 }
12935}
12936#[derive(Clone, Debug)]
12937pub(crate) struct ProgressBarMountedProps {
12938 minimum: Property<f64>,
12939 maximum: Property<f64>,
12940 value: Property<f64>,
12941 is_indeterminate: Property<bool>,
12942 show_error: Property<bool>,
12943 show_paused: Property<bool>,
12944 is_enabled: Property<bool>,
12945}
12946impl PartialEq for ProgressBarMountedProps {
12947 fn eq(&self, other: &Self) -> bool {
12948 true && f64_property_eq(&self.minimum, &other.minimum)
12949 && f64_property_eq(&self.maximum, &other.maximum)
12950 && f64_property_eq(&self.value, &other.value)
12951 && self.is_indeterminate == other.is_indeterminate
12952 && self.show_error == other.show_error
12953 && self.show_paused == other.show_paused
12954 && self.is_enabled == other.is_enabled
12955 }
12956}
12957#[derive(Clone, Debug)]
12958pub(crate) struct ToggleSwitchMountedProps {
12959 is_on: Property<bool>,
12960 is_enabled: Property<bool>,
12961 on_toggled: Option<Callback<bool>>,
12962}
12963impl PartialEq for ToggleSwitchMountedProps {
12964 fn eq(&self, other: &Self) -> bool {
12965 true && self.is_on == other.is_on
12966 && self.is_enabled == other.is_enabled
12967 && self.on_toggled == other.on_toggled
12968 }
12969}
12970#[derive(Clone, Debug)]
12971pub(crate) struct CheckBoxMountedProps {
12972 is_checked: Property<bool>,
12973 is_enabled: Property<bool>,
12974 on_is_checked_changed: Option<Callback<bool>>,
12975}
12976impl PartialEq for CheckBoxMountedProps {
12977 fn eq(&self, other: &Self) -> bool {
12978 true && self.is_checked == other.is_checked
12979 && self.is_enabled == other.is_enabled
12980 && self.on_is_checked_changed == other.on_is_checked_changed
12981 }
12982}
12983#[derive(Clone, Debug)]
12984pub(crate) struct ToggleButtonMountedProps {
12985 is_checked: Property<bool>,
12986 is_enabled: Property<bool>,
12987 on_is_checked_changed: Option<Callback<bool>>,
12988}
12989impl PartialEq for ToggleButtonMountedProps {
12990 fn eq(&self, other: &Self) -> bool {
12991 true && self.is_checked == other.is_checked
12992 && self.is_enabled == other.is_enabled
12993 && self.on_is_checked_changed == other.on_is_checked_changed
12994 }
12995}
12996#[derive(Clone, Debug)]
12997pub(crate) struct RadioButtonMountedProps {
12998 group_name: Property<String>,
12999 is_checked: Property<bool>,
13000 is_enabled: Property<bool>,
13001 on_checked: Option<Callback<bool>>,
13002}
13003impl PartialEq for RadioButtonMountedProps {
13004 fn eq(&self, other: &Self) -> bool {
13005 true && self.group_name == other.group_name
13006 && self.is_checked == other.is_checked
13007 && self.is_enabled == other.is_enabled
13008 && self.on_checked == other.on_checked
13009 }
13010}
13011#[derive(Clone, Debug)]
13012pub(crate) struct RadioButtonsMountedProps {
13013 items_source: Property<std::rc::Rc<Vec<String>>>,
13014 selected_index: Property<Option<usize>>,
13015 max_columns: Property<i32>,
13016 on_selection_changed: Option<Callback<Option<usize>>>,
13017}
13018impl PartialEq for RadioButtonsMountedProps {
13019 fn eq(&self, other: &Self) -> bool {
13020 true && self.items_source == other.items_source
13021 && self.selected_index == other.selected_index
13022 && self.max_columns == other.max_columns
13023 && self.on_selection_changed == other.on_selection_changed
13024 }
13025}
13026#[derive(Clone, Debug)]
13027pub(crate) struct ItemsRepeaterMountedProps {}
13028impl PartialEq for ItemsRepeaterMountedProps {
13029 fn eq(&self, _other: &Self) -> bool {
13030 true
13031 }
13032}
13033#[derive(Clone, Debug)]
13034pub(crate) struct InfoBadgeMountedProps {
13035 value: Property<i32>,
13036}
13037impl PartialEq for InfoBadgeMountedProps {
13038 fn eq(&self, other: &Self) -> bool {
13039 true && self.value == other.value
13040 }
13041}
13042#[derive(Clone, Debug)]
13043pub(crate) struct InfoBarMountedProps {
13044 title: Property<String>,
13045 message: Property<String>,
13046 severity: Property<InfoBarSeverity>,
13047 is_open: Property<bool>,
13048 is_closable: Property<bool>,
13049 on_closed: Option<Callback<()>>,
13050}
13051impl PartialEq for InfoBarMountedProps {
13052 fn eq(&self, other: &Self) -> bool {
13053 true && self.title == other.title
13054 && self.message == other.message
13055 && self.severity == other.severity
13056 && self.is_open == other.is_open
13057 && self.is_closable == other.is_closable
13058 && self.on_closed == other.on_closed
13059 }
13060}
13061#[derive(Clone, Debug)]
13062pub(crate) struct PersonPictureMountedProps {
13063 display_name: Property<String>,
13064 initials: Property<String>,
13065}
13066impl PartialEq for PersonPictureMountedProps {
13067 fn eq(&self, other: &Self) -> bool {
13068 true && self.display_name == other.display_name && self.initials == other.initials
13069 }
13070}
13071#[derive(Clone, Debug)]
13072pub(crate) struct ScrollViewerMountedProps {
13073 horizontal_scroll_bar_visibility: Property<ScrollBarVisibility>,
13074 vertical_scroll_bar_visibility: Property<ScrollBarVisibility>,
13075}
13076impl PartialEq for ScrollViewerMountedProps {
13077 fn eq(&self, other: &Self) -> bool {
13078 true && self.horizontal_scroll_bar_visibility == other.horizontal_scroll_bar_visibility
13079 && self.vertical_scroll_bar_visibility == other.vertical_scroll_bar_visibility
13080 }
13081}
13082#[derive(Clone, Debug)]
13083pub(crate) struct ScrollViewMountedProps {
13084 horizontal_scroll_bar_visibility: Property<ScrollingScrollBarVisibility>,
13085 vertical_scroll_bar_visibility: Property<ScrollingScrollBarVisibility>,
13086}
13087impl PartialEq for ScrollViewMountedProps {
13088 fn eq(&self, other: &Self) -> bool {
13089 true && self.horizontal_scroll_bar_visibility == other.horizontal_scroll_bar_visibility
13090 && self.vertical_scroll_bar_visibility == other.vertical_scroll_bar_visibility
13091 }
13092}
13093#[derive(Clone, Debug)]
13094pub(crate) struct ImageMountedProps {
13095 source: Property<ImageValue>,
13096 stretch: Property<Stretch>,
13097 events: Option<std::rc::Rc<ImageEvents>>,
13098}
13099impl PartialEq for ImageMountedProps {
13100 fn eq(&self, other: &Self) -> bool {
13101 true && self.source == other.source
13102 && self.stretch == other.stretch
13103 && self.events == other.events
13104 }
13105}
13106#[derive(Clone, Debug)]
13107pub(crate) struct ProgressRingMountedProps {
13108 minimum: Property<f64>,
13109 maximum: Property<f64>,
13110 value: Property<f64>,
13111 is_indeterminate: Property<bool>,
13112 is_active: Property<bool>,
13113 is_enabled: Property<bool>,
13114}
13115impl PartialEq for ProgressRingMountedProps {
13116 fn eq(&self, other: &Self) -> bool {
13117 true && f64_property_eq(&self.minimum, &other.minimum)
13118 && f64_property_eq(&self.maximum, &other.maximum)
13119 && f64_property_eq(&self.value, &other.value)
13120 && self.is_indeterminate == other.is_indeterminate
13121 && self.is_active == other.is_active
13122 && self.is_enabled == other.is_enabled
13123 }
13124}
13125#[derive(Clone, Debug)]
13126pub(crate) struct ListBoxMountedProps {
13127 is_enabled: Property<bool>,
13128 on_selected_tag_changed: Option<Callback<Option<String>>>,
13129}
13130impl PartialEq for ListBoxMountedProps {
13131 fn eq(&self, other: &Self) -> bool {
13132 true && self.is_enabled == other.is_enabled
13133 && self.on_selected_tag_changed == other.on_selected_tag_changed
13134 }
13135}
13136#[derive(Clone, Debug)]
13137pub(crate) struct RectangleMountedProps {
13138 fill: Property<Brush>,
13139 stroke: Property<Brush>,
13140 stroke_thickness: Property<f64>,
13141 radius_x: Property<f64>,
13142 radius_y: Property<f64>,
13143}
13144impl PartialEq for RectangleMountedProps {
13145 fn eq(&self, other: &Self) -> bool {
13146 true && self.fill == other.fill
13147 && self.stroke == other.stroke
13148 && f64_property_eq(&self.stroke_thickness, &other.stroke_thickness)
13149 && f64_property_eq(&self.radius_x, &other.radius_x)
13150 && f64_property_eq(&self.radius_y, &other.radius_y)
13151 }
13152}
13153#[derive(Clone, Debug)]
13154pub(crate) struct EllipseMountedProps {
13155 fill: Property<Brush>,
13156 stroke: Property<Brush>,
13157 stroke_thickness: Property<f64>,
13158}
13159impl PartialEq for EllipseMountedProps {
13160 fn eq(&self, other: &Self) -> bool {
13161 true && self.fill == other.fill
13162 && self.stroke == other.stroke
13163 && f64_property_eq(&self.stroke_thickness, &other.stroke_thickness)
13164 }
13165}
13166#[derive(Clone, Debug)]
13167pub(crate) struct LineMountedProps {
13168 stroke: Property<Brush>,
13169 stroke_thickness: Property<f64>,
13170 x1: Property<f64>,
13171 y1: Property<f64>,
13172 x2: Property<f64>,
13173 y2: Property<f64>,
13174}
13175impl PartialEq for LineMountedProps {
13176 fn eq(&self, other: &Self) -> bool {
13177 true && self.stroke == other.stroke
13178 && f64_property_eq(&self.stroke_thickness, &other.stroke_thickness)
13179 && f64_property_eq(&self.x1, &other.x1)
13180 && f64_property_eq(&self.y1, &other.y1)
13181 && f64_property_eq(&self.x2, &other.x2)
13182 && f64_property_eq(&self.y2, &other.y2)
13183 }
13184}
13185#[derive(Clone, Debug)]
13186pub(crate) struct SymbolIconMountedProps {
13187 symbol: Property<Symbol>,
13188}
13189impl PartialEq for SymbolIconMountedProps {
13190 fn eq(&self, other: &Self) -> bool {
13191 true && self.symbol == other.symbol
13192 }
13193}
13194#[derive(Clone, Debug)]
13195pub(crate) struct ImageIconMountedProps {
13196 source: Property<ImageValue>,
13197}
13198impl PartialEq for ImageIconMountedProps {
13199 fn eq(&self, other: &Self) -> bool {
13200 true && self.source == other.source
13201 }
13202}
13203#[derive(Clone, Debug)]
13204pub(crate) struct FontIconMountedProps {
13205 glyph: Property<String>,
13206}
13207impl PartialEq for FontIconMountedProps {
13208 fn eq(&self, other: &Self) -> bool {
13209 true && self.glyph == other.glyph
13210 }
13211}
13212#[derive(Clone, Debug)]
13213pub(crate) struct BitmapIconMountedProps {
13214 uri_source: Property<String>,
13215 show_as_monochrome: Property<bool>,
13216}
13217impl PartialEq for BitmapIconMountedProps {
13218 fn eq(&self, other: &Self) -> bool {
13219 true && self.uri_source == other.uri_source
13220 && self.show_as_monochrome == other.show_as_monochrome
13221 }
13222}
13223#[derive(Clone, Debug)]
13224pub(crate) struct PathIconMountedProps {
13225 data: Property<String>,
13226}
13227impl PartialEq for PathIconMountedProps {
13228 fn eq(&self, other: &Self) -> bool {
13229 true && self.data == other.data
13230 }
13231}
13232#[derive(Clone, Debug)]
13233pub(crate) struct ListBoxItemMountedProps {
13234 tag: Property<String>,
13235 is_selected: Property<bool>,
13236}
13237impl PartialEq for ListBoxItemMountedProps {
13238 fn eq(&self, other: &Self) -> bool {
13239 true && self.tag == other.tag && self.is_selected == other.is_selected
13240 }
13241}
13242#[derive(Clone, Debug)]
13243pub(crate) struct RatingControlMountedProps {
13244 max_rating: Property<i32>,
13245 value: Property<Option<f64>>,
13246 caption: Property<String>,
13247 is_read_only: Property<bool>,
13248 on_value_changed: Option<Callback<Option<f64>>>,
13249}
13250impl PartialEq for RatingControlMountedProps {
13251 fn eq(&self, other: &Self) -> bool {
13252 true && self.max_rating == other.max_rating
13253 && self.value == other.value
13254 && self.caption == other.caption
13255 && self.is_read_only == other.is_read_only
13256 && self.on_value_changed == other.on_value_changed
13257 }
13258}
13259#[derive(Clone, Debug)]
13260pub(crate) struct ExpanderMountedProps {
13261 is_expanded: Property<bool>,
13262 on_is_expanded_changed: Option<Callback<bool>>,
13263}
13264impl PartialEq for ExpanderMountedProps {
13265 fn eq(&self, other: &Self) -> bool {
13266 true && self.is_expanded == other.is_expanded
13267 && self.on_is_expanded_changed == other.on_is_expanded_changed
13268 }
13269}
13270#[derive(Clone, Debug)]
13271pub(crate) struct ComboBoxMountedProps {
13272 items_source: Property<std::rc::Rc<Vec<String>>>,
13273 selected_index: Property<Option<usize>>,
13274 placeholder_text: Property<String>,
13275 is_editable: Property<bool>,
13276 is_enabled: Property<bool>,
13277 on_selection_changed: Option<Callback<Option<usize>>>,
13278}
13279impl PartialEq for ComboBoxMountedProps {
13280 fn eq(&self, other: &Self) -> bool {
13281 true && self.items_source == other.items_source
13282 && self.selected_index == other.selected_index
13283 && self.placeholder_text == other.placeholder_text
13284 && self.is_editable == other.is_editable
13285 && self.is_enabled == other.is_enabled
13286 && self.on_selection_changed == other.on_selection_changed
13287 }
13288}
13289#[derive(Clone, Debug)]
13290pub(crate) struct PivotMountedProps {
13291 selected_index: Property<Option<usize>>,
13292 title: Property<String>,
13293 on_selection_changed: Option<Callback<Option<usize>>>,
13294}
13295impl PartialEq for PivotMountedProps {
13296 fn eq(&self, other: &Self) -> bool {
13297 true && self.selected_index == other.selected_index
13298 && self.title == other.title
13299 && self.on_selection_changed == other.on_selection_changed
13300 }
13301}
13302#[derive(Clone, Debug)]
13303pub(crate) struct PivotItemMountedProps {
13304 header: Property<String>,
13305}
13306impl PartialEq for PivotItemMountedProps {
13307 fn eq(&self, other: &Self) -> bool {
13308 true && self.header == other.header
13309 }
13310}
13311#[derive(Clone, Debug)]
13312pub(crate) struct FlipViewMountedProps {
13313 selected_index: Property<Option<usize>>,
13314 on_selection_changed: Option<Callback<Option<usize>>>,
13315}
13316impl PartialEq for FlipViewMountedProps {
13317 fn eq(&self, other: &Self) -> bool {
13318 true && self.selected_index == other.selected_index
13319 && self.on_selection_changed == other.on_selection_changed
13320 }
13321}
13322#[derive(Clone, Debug)]
13323pub(crate) struct SelectorBarMountedProps {
13324 on_selected_text_changed: Option<Callback<Option<String>>>,
13325}
13326impl PartialEq for SelectorBarMountedProps {
13327 fn eq(&self, other: &Self) -> bool {
13328 true && self.on_selected_text_changed == other.on_selected_text_changed
13329 }
13330}
13331#[derive(Clone, Debug)]
13332pub(crate) struct SelectorBarItemMountedProps {
13333 text: Property<String>,
13334 is_selected: Property<bool>,
13335}
13336impl PartialEq for SelectorBarItemMountedProps {
13337 fn eq(&self, other: &Self) -> bool {
13338 true && self.text == other.text && self.is_selected == other.is_selected
13339 }
13340}
13341#[derive(Clone, Debug)]
13342pub(crate) struct TabViewMountedProps {
13343 selected_index: Property<Option<usize>>,
13344 can_reorder_tabs: Property<bool>,
13345 is_add_tab_button_visible: Property<bool>,
13346 events: Option<std::rc::Rc<TabViewEvents>>,
13347}
13348impl PartialEq for TabViewMountedProps {
13349 fn eq(&self, other: &Self) -> bool {
13350 true && self.selected_index == other.selected_index
13351 && self.can_reorder_tabs == other.can_reorder_tabs
13352 && self.is_add_tab_button_visible == other.is_add_tab_button_visible
13353 && self.events == other.events
13354 }
13355}
13356#[derive(Clone, Debug)]
13357pub(crate) struct TabViewItemMountedProps {
13358 header: Property<String>,
13359 is_closable: Property<bool>,
13360 tag: Property<String>,
13361}
13362impl PartialEq for TabViewItemMountedProps {
13363 fn eq(&self, other: &Self) -> bool {
13364 true && self.header == other.header
13365 && self.is_closable == other.is_closable
13366 && self.tag == other.tag
13367 }
13368}
13369#[derive(Clone, Debug)]
13370pub(crate) struct TeachingTipMountedProps {
13371 title: Property<String>,
13372 subtitle: Property<String>,
13373 is_open: Property<bool>,
13374 is_light_dismiss_enabled: Property<bool>,
13375 preferred_placement: Property<TeachingTipPlacementMode>,
13376 action_button_content: Property<String>,
13377 close_button_content: Property<String>,
13378 events: Option<std::rc::Rc<TeachingTipEvents>>,
13379}
13380impl PartialEq for TeachingTipMountedProps {
13381 fn eq(&self, other: &Self) -> bool {
13382 true && self.title == other.title
13383 && self.subtitle == other.subtitle
13384 && self.is_open == other.is_open
13385 && self.is_light_dismiss_enabled == other.is_light_dismiss_enabled
13386 && self.preferred_placement == other.preferred_placement
13387 && self.action_button_content == other.action_button_content
13388 && self.close_button_content == other.close_button_content
13389 && self.events == other.events
13390 }
13391}
13392#[derive(Clone, Debug)]
13393pub(crate) struct DropDownButtonMountedProps {
13394 is_enabled: Property<bool>,
13395 on_click: Option<Callback<()>>,
13396}
13397impl PartialEq for DropDownButtonMountedProps {
13398 fn eq(&self, other: &Self) -> bool {
13399 true && self.is_enabled == other.is_enabled && self.on_click == other.on_click
13400 }
13401}
13402#[derive(Clone, Debug)]
13403pub(crate) struct CommandBarMountedProps {}
13404impl PartialEq for CommandBarMountedProps {
13405 fn eq(&self, _other: &Self) -> bool {
13406 true
13407 }
13408}
13409#[derive(Clone, Debug)]
13410pub(crate) struct AppBarButtonMountedProps {
13411 label: Property<String>,
13412 is_enabled: Property<bool>,
13413 on_click: Option<Callback<()>>,
13414}
13415impl PartialEq for AppBarButtonMountedProps {
13416 fn eq(&self, other: &Self) -> bool {
13417 true && self.label == other.label
13418 && self.is_enabled == other.is_enabled
13419 && self.on_click == other.on_click
13420 }
13421}
13422#[derive(Clone, Debug)]
13423pub(crate) struct AppBarSeparatorMountedProps {}
13424impl PartialEq for AppBarSeparatorMountedProps {
13425 fn eq(&self, _other: &Self) -> bool {
13426 true
13427 }
13428}
13429#[derive(Clone, Debug)]
13430pub(crate) struct MenuBarMountedProps {}
13431impl PartialEq for MenuBarMountedProps {
13432 fn eq(&self, _other: &Self) -> bool {
13433 true
13434 }
13435}
13436#[derive(Clone, Debug)]
13437pub(crate) struct MenuBarItemMountedProps {
13438 title: Property<String>,
13439}
13440impl PartialEq for MenuBarItemMountedProps {
13441 fn eq(&self, other: &Self) -> bool {
13442 true && self.title == other.title
13443 }
13444}
13445#[derive(Clone, Debug)]
13446pub(crate) struct SplitButtonMountedProps {
13447 is_enabled: Property<bool>,
13448 on_click: Option<Callback<()>>,
13449}
13450impl PartialEq for SplitButtonMountedProps {
13451 fn eq(&self, other: &Self) -> bool {
13452 true && self.is_enabled == other.is_enabled && self.on_click == other.on_click
13453 }
13454}
13455#[derive(Clone, Debug)]
13456pub(crate) struct ColorPickerMountedProps {
13457 color: Property<Color>,
13458 is_alpha_enabled: Property<bool>,
13459 is_hex_input_visible: Property<bool>,
13460 is_color_slider_visible: Property<bool>,
13461 is_color_channel_text_input_visible: Property<bool>,
13462 is_enabled: Property<bool>,
13463 on_color_changed: Option<Callback<Color>>,
13464}
13465impl PartialEq for ColorPickerMountedProps {
13466 fn eq(&self, other: &Self) -> bool {
13467 true && self.color == other.color
13468 && self.is_alpha_enabled == other.is_alpha_enabled
13469 && self.is_hex_input_visible == other.is_hex_input_visible
13470 && self.is_color_slider_visible == other.is_color_slider_visible
13471 && self.is_color_channel_text_input_visible == other.is_color_channel_text_input_visible
13472 && self.is_enabled == other.is_enabled
13473 && self.on_color_changed == other.on_color_changed
13474 }
13475}
13476#[derive(Clone, Debug)]
13477pub(crate) struct DatePickerMountedProps {
13478 day_visible: Property<bool>,
13479 month_visible: Property<bool>,
13480 year_visible: Property<bool>,
13481 is_enabled: Property<bool>,
13482 on_selected_date_changed: Option<Callback<Option<windows_time::DateTime>>>,
13483}
13484impl PartialEq for DatePickerMountedProps {
13485 fn eq(&self, other: &Self) -> bool {
13486 true && self.day_visible == other.day_visible
13487 && self.month_visible == other.month_visible
13488 && self.year_visible == other.year_visible
13489 && self.is_enabled == other.is_enabled
13490 && self.on_selected_date_changed == other.on_selected_date_changed
13491 }
13492}
13493#[derive(Clone, Debug)]
13494pub(crate) struct TimePickerMountedProps {
13495 clock_identifier: Property<String>,
13496 minute_increment: Property<i32>,
13497 is_enabled: Property<bool>,
13498 on_selected_time_changed: Option<Callback<Option<windows_time::TimeSpan>>>,
13499}
13500impl PartialEq for TimePickerMountedProps {
13501 fn eq(&self, other: &Self) -> bool {
13502 true && self.clock_identifier == other.clock_identifier
13503 && self.minute_increment == other.minute_increment
13504 && self.is_enabled == other.is_enabled
13505 && self.on_selected_time_changed == other.on_selected_time_changed
13506 }
13507}
13508#[derive(Clone, Debug)]
13509pub(crate) struct CalendarDatePickerMountedProps {
13510 placeholder_text: Property<String>,
13511 is_today_highlighted: Property<bool>,
13512 is_calendar_open: Property<bool>,
13513 is_enabled: Property<bool>,
13514 on_date_changed: Option<Callback<Option<windows_time::DateTime>>>,
13515}
13516impl PartialEq for CalendarDatePickerMountedProps {
13517 fn eq(&self, other: &Self) -> bool {
13518 true && self.placeholder_text == other.placeholder_text
13519 && self.is_today_highlighted == other.is_today_highlighted
13520 && self.is_calendar_open == other.is_calendar_open
13521 && self.is_enabled == other.is_enabled
13522 && self.on_date_changed == other.on_date_changed
13523 }
13524}
13525#[derive(Clone, Debug)]
13526pub(crate) struct ToolTipMountedProps {}
13527impl PartialEq for ToolTipMountedProps {
13528 fn eq(&self, _other: &Self) -> bool {
13529 true
13530 }
13531}
13532#[derive(Clone, Debug)]
13533pub(crate) struct ContentDialogMountedProps {
13534 title: Property<String>,
13535 primary_button_text: Property<String>,
13536 secondary_button_text: Property<String>,
13537 close_button_text: Property<String>,
13538 is_primary_button_enabled: Property<bool>,
13539 is_secondary_button_enabled: Property<bool>,
13540 on_closed: Option<Callback<ContentDialogResult>>,
13541}
13542impl PartialEq for ContentDialogMountedProps {
13543 fn eq(&self, other: &Self) -> bool {
13544 true && self.title == other.title
13545 && self.primary_button_text == other.primary_button_text
13546 && self.secondary_button_text == other.secondary_button_text
13547 && self.close_button_text == other.close_button_text
13548 && self.is_primary_button_enabled == other.is_primary_button_enabled
13549 && self.is_secondary_button_enabled == other.is_secondary_button_enabled
13550 && self.on_closed == other.on_closed
13551 }
13552}
13553#[derive(Clone, Debug)]
13554pub(crate) struct CalendarViewMountedProps {
13555 is_today_highlighted: Property<bool>,
13556 is_group_label_visible: Property<bool>,
13557 is_enabled: Property<bool>,
13558 on_selected_dates_changed: Option<Callback<()>>,
13559}
13560impl PartialEq for CalendarViewMountedProps {
13561 fn eq(&self, other: &Self) -> bool {
13562 true && self.is_today_highlighted == other.is_today_highlighted
13563 && self.is_group_label_visible == other.is_group_label_visible
13564 && self.is_enabled == other.is_enabled
13565 && self.on_selected_dates_changed == other.on_selected_dates_changed
13566 }
13567}
13568#[derive(Clone, Debug)]
13569pub(crate) struct ListViewMountedProps {
13570 selected_index: Property<Option<usize>>,
13571 selection_mode: Property<ListViewSelectionMode>,
13572 can_drag_items: Property<bool>,
13573 can_reorder_items: Property<bool>,
13574 allow_drop: Property<bool>,
13575 events: Option<std::rc::Rc<ListViewEvents>>,
13576}
13577impl PartialEq for ListViewMountedProps {
13578 fn eq(&self, other: &Self) -> bool {
13579 true && self.selected_index == other.selected_index
13580 && self.selection_mode == other.selection_mode
13581 && self.can_drag_items == other.can_drag_items
13582 && self.can_reorder_items == other.can_reorder_items
13583 && self.allow_drop == other.allow_drop
13584 && self.events == other.events
13585 }
13586}
13587#[derive(Clone, Debug)]
13588pub(crate) struct ListViewItemMountedProps {
13589 tag: Property<String>,
13590}
13591impl PartialEq for ListViewItemMountedProps {
13592 fn eq(&self, other: &Self) -> bool {
13593 true && self.tag == other.tag
13594 }
13595}
13596#[derive(Clone, Debug)]
13597pub(crate) struct TreeViewMountedProps {
13598 selection_mode: Property<TreeViewSelectionMode>,
13599 on_item_invoked: Option<Callback<String>>,
13600}
13601impl PartialEq for TreeViewMountedProps {
13602 fn eq(&self, other: &Self) -> bool {
13603 true && self.selection_mode == other.selection_mode
13604 && self.on_item_invoked == other.on_item_invoked
13605 }
13606}
13607#[derive(Clone, Debug)]
13608pub(crate) struct GridViewMountedProps {
13609 selected_index: Property<Option<usize>>,
13610 can_drag_items: Property<bool>,
13611 can_reorder_items: Property<bool>,
13612 allow_drop: Property<bool>,
13613 events: Option<std::rc::Rc<GridViewEvents>>,
13614}
13615impl PartialEq for GridViewMountedProps {
13616 fn eq(&self, other: &Self) -> bool {
13617 true && self.selected_index == other.selected_index
13618 && self.can_drag_items == other.can_drag_items
13619 && self.can_reorder_items == other.can_reorder_items
13620 && self.allow_drop == other.allow_drop
13621 && self.events == other.events
13622 }
13623}
13624#[derive(Clone, Debug)]
13625pub(crate) struct GridViewItemMountedProps {
13626 tag: Property<String>,
13627}
13628impl PartialEq for GridViewItemMountedProps {
13629 fn eq(&self, other: &Self) -> bool {
13630 true && self.tag == other.tag
13631 }
13632}
13633#[derive(Clone, Debug)]
13634pub(crate) struct RelativePanelMountedProps {}
13635impl PartialEq for RelativePanelMountedProps {
13636 fn eq(&self, _other: &Self) -> bool {
13637 true
13638 }
13639}
13640#[derive(Clone, Debug)]
13641pub(crate) struct CanvasMountedProps {}
13642impl PartialEq for CanvasMountedProps {
13643 fn eq(&self, _other: &Self) -> bool {
13644 true
13645 }
13646}
13647#[derive(Clone, Debug)]
13648pub(crate) struct RichEditBoxMountedProps {
13649 text: Property<String>,
13650 placeholder_text: Property<String>,
13651 is_read_only: Property<bool>,
13652 is_enabled: Property<bool>,
13653 on_text_changed: Option<Callback<String>>,
13654}
13655impl PartialEq for RichEditBoxMountedProps {
13656 fn eq(&self, other: &Self) -> bool {
13657 true && self.text == other.text
13658 && self.placeholder_text == other.placeholder_text
13659 && self.is_read_only == other.is_read_only
13660 && self.is_enabled == other.is_enabled
13661 && self.on_text_changed == other.on_text_changed
13662 }
13663}
13664#[derive(Clone, Debug)]
13665pub(crate) struct RichTextBlockMountedProps {
13666 paragraphs: Property<RichText>,
13667 font_size: Property<f64>,
13668 is_text_selection_enabled: Property<bool>,
13669 text_wrapping: Property<TextWrapping>,
13670}
13671impl PartialEq for RichTextBlockMountedProps {
13672 fn eq(&self, other: &Self) -> bool {
13673 true && self.paragraphs == other.paragraphs
13674 && f64_property_eq(&self.font_size, &other.font_size)
13675 && self.is_text_selection_enabled == other.is_text_selection_enabled
13676 && self.text_wrapping == other.text_wrapping
13677 }
13678}
13679#[derive(Clone, Debug)]
13680pub(crate) struct ViewboxMountedProps {
13681 stretch: Property<Stretch>,
13682}
13683impl PartialEq for ViewboxMountedProps {
13684 fn eq(&self, other: &Self) -> bool {
13685 true && self.stretch == other.stretch
13686 }
13687}
13688#[derive(Clone, Debug)]
13689pub(crate) struct WebView2MountedProps {}
13690impl PartialEq for WebView2MountedProps {
13691 fn eq(&self, _other: &Self) -> bool {
13692 true
13693 }
13694}
13695#[derive(Clone, Debug)]
13696pub(crate) struct SwapChainPanelMountedProps {}
13697impl PartialEq for SwapChainPanelMountedProps {
13698 fn eq(&self, _other: &Self) -> bool {
13699 true
13700 }
13701}
13702#[derive(Clone, Debug, PartialEq)]
13703pub enum MountedProps {
13704 TextBlock(std::rc::Rc<TextBlockMountedProps>),
13705 Button(std::rc::Rc<ButtonMountedProps>),
13706 HyperlinkButton(std::rc::Rc<HyperlinkButtonMountedProps>),
13707 RepeatButton(std::rc::Rc<RepeatButtonMountedProps>),
13708 Border(std::rc::Rc<BorderMountedProps>),
13709 BreadcrumbBar(std::rc::Rc<BreadcrumbBarMountedProps>),
13710 StackPanel(std::rc::Rc<StackPanelMountedProps>),
13711 VariableSizedWrapGrid(std::rc::Rc<VariableSizedWrapGridMountedProps>),
13712 Grid(std::rc::Rc<GridMountedProps>),
13713 TextBox(std::rc::Rc<TextBoxMountedProps>),
13714 AutoSuggestBox(std::rc::Rc<AutoSuggestBoxMountedProps>),
13715 PasswordBox(std::rc::Rc<PasswordBoxMountedProps>),
13716 NumberBox(std::rc::Rc<NumberBoxMountedProps>),
13717 Slider(std::rc::Rc<SliderMountedProps>),
13718 TitleBar(std::rc::Rc<TitleBarMountedProps>),
13719 NavigationView(std::rc::Rc<NavigationViewMountedProps>),
13720 NavigationViewItem(std::rc::Rc<NavigationViewItemMountedProps>),
13721 SplitView(std::rc::Rc<SplitViewMountedProps>),
13722 ProgressBar(std::rc::Rc<ProgressBarMountedProps>),
13723 ToggleSwitch(std::rc::Rc<ToggleSwitchMountedProps>),
13724 CheckBox(std::rc::Rc<CheckBoxMountedProps>),
13725 ToggleButton(std::rc::Rc<ToggleButtonMountedProps>),
13726 RadioButton(std::rc::Rc<RadioButtonMountedProps>),
13727 RadioButtons(std::rc::Rc<RadioButtonsMountedProps>),
13728 ItemsRepeater(std::rc::Rc<ItemsRepeaterMountedProps>),
13729 InfoBadge(std::rc::Rc<InfoBadgeMountedProps>),
13730 InfoBar(std::rc::Rc<InfoBarMountedProps>),
13731 PersonPicture(std::rc::Rc<PersonPictureMountedProps>),
13732 ScrollViewer(std::rc::Rc<ScrollViewerMountedProps>),
13733 ScrollView(std::rc::Rc<ScrollViewMountedProps>),
13734 Image(std::rc::Rc<ImageMountedProps>),
13735 ProgressRing(std::rc::Rc<ProgressRingMountedProps>),
13736 ListBox(std::rc::Rc<ListBoxMountedProps>),
13737 Rectangle(std::rc::Rc<RectangleMountedProps>),
13738 Ellipse(std::rc::Rc<EllipseMountedProps>),
13739 Line(std::rc::Rc<LineMountedProps>),
13740 SymbolIcon(std::rc::Rc<SymbolIconMountedProps>),
13741 ImageIcon(std::rc::Rc<ImageIconMountedProps>),
13742 FontIcon(std::rc::Rc<FontIconMountedProps>),
13743 BitmapIcon(std::rc::Rc<BitmapIconMountedProps>),
13744 PathIcon(std::rc::Rc<PathIconMountedProps>),
13745 ListBoxItem(std::rc::Rc<ListBoxItemMountedProps>),
13746 RatingControl(std::rc::Rc<RatingControlMountedProps>),
13747 Expander(std::rc::Rc<ExpanderMountedProps>),
13748 ComboBox(std::rc::Rc<ComboBoxMountedProps>),
13749 Pivot(std::rc::Rc<PivotMountedProps>),
13750 PivotItem(std::rc::Rc<PivotItemMountedProps>),
13751 FlipView(std::rc::Rc<FlipViewMountedProps>),
13752 SelectorBar(std::rc::Rc<SelectorBarMountedProps>),
13753 SelectorBarItem(std::rc::Rc<SelectorBarItemMountedProps>),
13754 TabView(std::rc::Rc<TabViewMountedProps>),
13755 TabViewItem(std::rc::Rc<TabViewItemMountedProps>),
13756 TeachingTip(std::rc::Rc<TeachingTipMountedProps>),
13757 DropDownButton(std::rc::Rc<DropDownButtonMountedProps>),
13758 CommandBar(std::rc::Rc<CommandBarMountedProps>),
13759 AppBarButton(std::rc::Rc<AppBarButtonMountedProps>),
13760 AppBarSeparator(std::rc::Rc<AppBarSeparatorMountedProps>),
13761 MenuBar(std::rc::Rc<MenuBarMountedProps>),
13762 MenuBarItem(std::rc::Rc<MenuBarItemMountedProps>),
13763 SplitButton(std::rc::Rc<SplitButtonMountedProps>),
13764 ColorPicker(std::rc::Rc<ColorPickerMountedProps>),
13765 DatePicker(std::rc::Rc<DatePickerMountedProps>),
13766 TimePicker(std::rc::Rc<TimePickerMountedProps>),
13767 CalendarDatePicker(std::rc::Rc<CalendarDatePickerMountedProps>),
13768 ToolTip(std::rc::Rc<ToolTipMountedProps>),
13769 ContentDialog(std::rc::Rc<ContentDialogMountedProps>),
13770 CalendarView(std::rc::Rc<CalendarViewMountedProps>),
13771 ListView(std::rc::Rc<ListViewMountedProps>),
13772 ListViewItem(std::rc::Rc<ListViewItemMountedProps>),
13773 TreeView(std::rc::Rc<TreeViewMountedProps>),
13774 GridView(std::rc::Rc<GridViewMountedProps>),
13775 GridViewItem(std::rc::Rc<GridViewItemMountedProps>),
13776 RelativePanel(std::rc::Rc<RelativePanelMountedProps>),
13777 Canvas(std::rc::Rc<CanvasMountedProps>),
13778 RichEditBox(std::rc::Rc<RichEditBoxMountedProps>),
13779 RichTextBlock(std::rc::Rc<RichTextBlockMountedProps>),
13780 Viewbox(std::rc::Rc<ViewboxMountedProps>),
13781 WebView2(std::rc::Rc<WebView2MountedProps>),
13782 SwapChainPanel(std::rc::Rc<SwapChainPanelMountedProps>),
13783}
13784#[derive(Clone, Debug, PartialEq)]
13785pub enum ElementStructure {
13786 None,
13787 Content(Option<Element>),
13788 Children(std::rc::Rc<Vec<KeyedElement>>),
13789 Virtual(VirtualItems),
13790}
13791#[derive(Clone, Copy)]
13792pub enum ElementStructureRef<'a> {
13793 None,
13794 Content(Option<&'a Element>),
13795 Children(&'a [KeyedElement]),
13796 Virtual(&'a VirtualItems),
13797}
13798#[derive(Clone, Debug, PartialEq)]
13799pub struct ElementParts {
13800 pub kind: MountedKind,
13801 pub props: MountedProps,
13802 pub reference: Option<NativeElementRef>,
13803 pub element_state: Option<std::rc::Rc<ElementState>>,
13804 pub window_title_bar: Option<WindowTitleBarHeight>,
13805 pub structure: ElementStructure,
13806}
13807#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
13808pub enum PropertyId {
13809 Width,
13810 Height,
13811 MinWidth,
13812 MaxWidth,
13813 MinHeight,
13814 MaxHeight,
13815 Opacity,
13816 HorizontalAlignment,
13817 VerticalAlignment,
13818 Margin,
13819 GridRow,
13820 GridColumn,
13821 GridRowSpan,
13822 GridColumnSpan,
13823 GridRows,
13824 GridColumns,
13825 RelativeAlignLeft,
13826 RelativeAlignTop,
13827 RelativeAlignRight,
13828 RelativeAlignBottom,
13829 RelativeAlignHorizontalCenter,
13830 RelativeAlignVerticalCenter,
13831 CanvasLeft,
13832 CanvasTop,
13833 AutomationName,
13834 AutomationId,
13835 AutomationHeadingLevel,
13836 TextBlockText,
13837 TextBlockTextWrapping,
13838 TextBlockFontSize,
13839 TextBlockFontWeight,
13840 TextBlockIsTextSelectionEnabled,
13841 TextBlockMaxLines,
13842 TextBlockTextTrimming,
13843 TextBlockForeground,
13844 ButtonIsEnabled,
13845 ButtonHorizontalContentAlignment,
13846 ButtonVerticalContentAlignment,
13847 ButtonResources,
13848 ButtonStyle,
13849 ButtonKeyboardAccelerators,
13850 HyperlinkButtonNavigateUri,
13851 HyperlinkButtonIsEnabled,
13852 RepeatButtonDelay,
13853 RepeatButtonInterval,
13854 RepeatButtonIsEnabled,
13855 BorderPadding,
13856 BorderBorderThickness,
13857 BorderCornerRadius,
13858 BorderBackground,
13859 BorderBorderBrush,
13860 BorderOpacityTransition,
13861 BorderScale,
13862 BorderScaleTransition,
13863 BorderCapturePointerOnPress,
13864 BorderAllowDrop,
13865 BreadcrumbBarItemsSource,
13866 StackPanelOrientation,
13867 StackPanelSpacing,
13868 VariableSizedWrapGridItemWidth,
13869 VariableSizedWrapGridItemHeight,
13870 VariableSizedWrapGridOrientation,
13871 GridRowSpacing,
13872 GridColumnSpacing,
13873 GridKeyboardAccelerators,
13874 GridBackground,
13875 TextBoxText,
13876 TextBoxPlaceholderText,
13877 TextBoxIsEnabled,
13878 TextBoxAcceptsReturn,
13879 TextBoxTextWrapping,
13880 TextBoxBackground,
13881 TextBoxBorderBrush,
13882 TextBoxBorderThickness,
13883 AutoSuggestBoxText,
13884 AutoSuggestBoxItemsSource,
13885 AutoSuggestBoxPlaceholderText,
13886 AutoSuggestBoxIsEnabled,
13887 PasswordBoxPassword,
13888 PasswordBoxPlaceholderText,
13889 PasswordBoxPasswordRevealMode,
13890 PasswordBoxIsEnabled,
13891 NumberBoxMinimum,
13892 NumberBoxMaximum,
13893 NumberBoxValue,
13894 NumberBoxIsEnabled,
13895 SliderMinimum,
13896 SliderMaximum,
13897 SliderValue,
13898 SliderIsEnabled,
13899 SliderStepFrequency,
13900 SliderOrientation,
13901 TitleBarTitle,
13902 TitleBarSubtitle,
13903 TitleBarIsBackButtonVisible,
13904 TitleBarIsBackButtonEnabled,
13905 TitleBarIsPaneToggleButtonVisible,
13906 NavigationViewIsEnabled,
13907 NavigationViewPaneDisplayMode,
13908 NavigationViewIsPaneToggleButtonVisible,
13909 NavigationViewIsBackButtonVisible,
13910 NavigationViewIsSettingsVisible,
13911 NavigationViewAlwaysShowHeader,
13912 NavigationViewPaneTitle,
13913 NavigationViewOpenPaneLength,
13914 NavigationViewIsPaneOpen,
13915 NavigationViewItemTag,
13916 NavigationViewItemIsSelected,
13917 NavigationViewItemSelectsOnInvoked,
13918 NavigationViewItemIsExpanded,
13919 SplitViewOpenPaneLength,
13920 SplitViewCompactPaneLength,
13921 SplitViewDisplayMode,
13922 SplitViewIsPaneOpen,
13923 ProgressBarMinimum,
13924 ProgressBarMaximum,
13925 ProgressBarValue,
13926 ProgressBarIsIndeterminate,
13927 ProgressBarShowError,
13928 ProgressBarShowPaused,
13929 ProgressBarIsEnabled,
13930 ToggleSwitchIsOn,
13931 ToggleSwitchIsEnabled,
13932 CheckBoxIsChecked,
13933 CheckBoxIsEnabled,
13934 ToggleButtonIsChecked,
13935 ToggleButtonIsEnabled,
13936 RadioButtonGroupName,
13937 RadioButtonIsChecked,
13938 RadioButtonIsEnabled,
13939 RadioButtonsItemsSource,
13940 RadioButtonsSelectedIndex,
13941 RadioButtonsMaxColumns,
13942 InfoBadgeValue,
13943 InfoBarTitle,
13944 InfoBarMessage,
13945 InfoBarSeverity,
13946 InfoBarIsOpen,
13947 InfoBarIsClosable,
13948 PersonPictureDisplayName,
13949 PersonPictureInitials,
13950 ScrollViewerHorizontalScrollBarVisibility,
13951 ScrollViewerVerticalScrollBarVisibility,
13952 ScrollViewHorizontalScrollBarVisibility,
13953 ScrollViewVerticalScrollBarVisibility,
13954 ImageSource,
13955 ImageStretch,
13956 ProgressRingMinimum,
13957 ProgressRingMaximum,
13958 ProgressRingValue,
13959 ProgressRingIsIndeterminate,
13960 ProgressRingIsActive,
13961 ProgressRingIsEnabled,
13962 ListBoxIsEnabled,
13963 RectangleFill,
13964 RectangleStroke,
13965 RectangleStrokeThickness,
13966 RectangleRadiusX,
13967 RectangleRadiusY,
13968 EllipseFill,
13969 EllipseStroke,
13970 EllipseStrokeThickness,
13971 LineStroke,
13972 LineStrokeThickness,
13973 LineX1,
13974 LineY1,
13975 LineX2,
13976 LineY2,
13977 SymbolIconSymbol,
13978 ImageIconSource,
13979 FontIconGlyph,
13980 BitmapIconUriSource,
13981 BitmapIconShowAsMonochrome,
13982 PathIconData,
13983 ListBoxItemTag,
13984 ListBoxItemIsSelected,
13985 RatingControlMaxRating,
13986 RatingControlValue,
13987 RatingControlCaption,
13988 RatingControlIsReadOnly,
13989 ExpanderIsExpanded,
13990 ComboBoxItemsSource,
13991 ComboBoxSelectedIndex,
13992 ComboBoxPlaceholderText,
13993 ComboBoxIsEditable,
13994 ComboBoxIsEnabled,
13995 PivotSelectedIndex,
13996 PivotTitle,
13997 PivotItemHeader,
13998 FlipViewSelectedIndex,
13999 SelectorBarItemText,
14000 SelectorBarItemIsSelected,
14001 TabViewSelectedIndex,
14002 TabViewCanReorderTabs,
14003 TabViewIsAddTabButtonVisible,
14004 TabViewItemHeader,
14005 TabViewItemIsClosable,
14006 TabViewItemTag,
14007 TeachingTipTitle,
14008 TeachingTipSubtitle,
14009 TeachingTipIsOpen,
14010 TeachingTipIsLightDismissEnabled,
14011 TeachingTipPreferredPlacement,
14012 TeachingTipActionButtonContent,
14013 TeachingTipCloseButtonContent,
14014 DropDownButtonIsEnabled,
14015 AppBarButtonLabel,
14016 AppBarButtonIsEnabled,
14017 MenuBarItemTitle,
14018 SplitButtonIsEnabled,
14019 ColorPickerColor,
14020 ColorPickerIsAlphaEnabled,
14021 ColorPickerIsHexInputVisible,
14022 ColorPickerIsColorSliderVisible,
14023 ColorPickerIsColorChannelTextInputVisible,
14024 ColorPickerIsEnabled,
14025 DatePickerDayVisible,
14026 DatePickerMonthVisible,
14027 DatePickerYearVisible,
14028 DatePickerIsEnabled,
14029 TimePickerClockIdentifier,
14030 TimePickerMinuteIncrement,
14031 TimePickerIsEnabled,
14032 CalendarDatePickerPlaceholderText,
14033 CalendarDatePickerIsTodayHighlighted,
14034 CalendarDatePickerIsCalendarOpen,
14035 CalendarDatePickerIsEnabled,
14036 ContentDialogTitle,
14037 ContentDialogPrimaryButtonText,
14038 ContentDialogSecondaryButtonText,
14039 ContentDialogCloseButtonText,
14040 ContentDialogIsPrimaryButtonEnabled,
14041 ContentDialogIsSecondaryButtonEnabled,
14042 CalendarViewIsTodayHighlighted,
14043 CalendarViewIsGroupLabelVisible,
14044 CalendarViewIsEnabled,
14045 ListViewSelectedIndex,
14046 ListViewSelectionMode,
14047 ListViewCanDragItems,
14048 ListViewCanReorderItems,
14049 ListViewAllowDrop,
14050 ListViewItemTag,
14051 TreeViewSelectionMode,
14052 GridViewSelectedIndex,
14053 GridViewCanDragItems,
14054 GridViewCanReorderItems,
14055 GridViewAllowDrop,
14056 GridViewItemTag,
14057 RichEditBoxDocument,
14058 RichEditBoxPlaceholderText,
14059 RichEditBoxIsReadOnly,
14060 RichEditBoxIsEnabled,
14061 RichTextBlockBlocks,
14062 RichTextBlockFontSize,
14063 RichTextBlockIsTextSelectionEnabled,
14064 RichTextBlockTextWrapping,
14065 ViewboxStretch,
14066}
14067#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14068pub enum EventId {
14069 OwnedCommandInvoked,
14070 OwnedMenuItemInvoked,
14071 ButtonClick,
14072 HyperlinkButtonClick,
14073 RepeatButtonClick,
14074 BorderDragEnter,
14075 BorderDragOver,
14076 BorderDragLeave,
14077 BorderDrop,
14078 BorderPointerPressed,
14079 BorderPointerMoved,
14080 BorderPointerEntered,
14081 BorderPointerExited,
14082 BorderPointerReleased,
14083 BorderPointerCaptureLost,
14084 BorderPointerCanceled,
14085 BreadcrumbBarItemClicked,
14086 TextBoxTextChanged,
14087 AutoSuggestBoxTextChanged,
14088 AutoSuggestBoxSuggestionChosen,
14089 PasswordBoxPasswordChanged,
14090 NumberBoxValueChanged,
14091 SliderValueChanged,
14092 TitleBarBackRequested,
14093 TitleBarPaneToggleRequested,
14094 NavigationViewIsPaneOpenChanged,
14095 NavigationViewDisplayModeChanged,
14096 NavigationViewSelectionChanged,
14097 SplitViewPaneClosed,
14098 ToggleSwitchToggled,
14099 CheckBoxIsCheckedChanged,
14100 ToggleButtonIsCheckedChanged,
14101 RadioButtonChecked,
14102 RadioButtonsSelectionChanged,
14103 InfoBarClosed,
14104 ImageImageOpened,
14105 ImageImageFailed,
14106 ListBoxSelectionChanged,
14107 RatingControlValueChanged,
14108 ExpanderIsExpandedChanged,
14109 ComboBoxSelectionChanged,
14110 PivotSelectionChanged,
14111 FlipViewSelectionChanged,
14112 SelectorBarSelectionChanged,
14113 TabViewSelectionChanged,
14114 TabViewTabCloseRequested,
14115 TabViewAddTabButtonClick,
14116 TabViewTabItemsChanged,
14117 TeachingTipClosed,
14118 TeachingTipActionButtonClick,
14119 DropDownButtonClick,
14120 AppBarButtonClick,
14121 SplitButtonClick,
14122 ColorPickerColorChanged,
14123 DatePickerSelectedDateChanged,
14124 TimePickerSelectedTimeChanged,
14125 CalendarDatePickerDateChanged,
14126 ContentDialogClosed,
14127 CalendarViewSelectedDatesChanged,
14128 ListViewSelectionChanged,
14129 ListViewDragItemsCompleted,
14130 TreeViewItemInvoked,
14131 GridViewDragItemsCompleted,
14132 GridViewSelectionChanged,
14133 RichEditBoxTextChanged,
14134}
14135#[derive(Clone, Debug)]
14136pub enum PropertyValue {
14137 Bool(bool),
14138 Brush(Brush),
14139 ButtonStyle(ButtonStyle),
14140 Color(Color),
14141 CornerRadius(CornerRadius),
14142 DragDropPolicy(DragDropPolicy),
14143 Duration(std::time::Duration),
14144 EncodedImage(EncodedImage),
14145 F64(f64),
14146 FontWeight(FontWeight),
14147 GridLengths(std::rc::Rc<Vec<GridLength>>),
14148 HorizontalAlignment(HorizontalAlignment),
14149 I32(i32),
14150 InfoBarSeverity(InfoBarSeverity),
14151 KeyAccelerators(KeyAccelerators),
14152 ListViewSelectionMode(ListViewSelectionMode),
14153 NavigationViewBackButtonVisible(NavigationViewBackButtonVisible),
14154 NavigationViewPaneDisplayMode(NavigationViewPaneDisplayMode),
14155 OptionalF64(Option<f64>),
14156 Orientation(Orientation),
14157 PasswordRevealMode(PasswordRevealMode),
14158 ResourceOverrides(ResourceOverrides),
14159 RichText(RichText),
14160 ScrollBarVisibility(ScrollBarVisibility),
14161 ScrollingScrollBarVisibility(ScrollingScrollBarVisibility),
14162 SelectionIndex(Option<usize>),
14163 SplitViewDisplayMode(SplitViewDisplayMode),
14164 Str(String),
14165 StrList(std::rc::Rc<Vec<String>>),
14166 Stretch(Stretch),
14167 Symbol(Symbol),
14168 TeachingTipPlacementMode(TeachingTipPlacementMode),
14169 TextTrimming(TextTrimming),
14170 TextWrapping(TextWrapping),
14171 Thickness(Thickness),
14172 TreeViewSelectionMode(TreeViewSelectionMode),
14173 VerticalAlignment(VerticalAlignment),
14174}
14175impl PartialEq for PropertyValue {
14176 fn eq(&self, other: &Self) -> bool {
14177 match (self, other) {
14178 (Self::Bool(left), Self::Bool(right)) => left == right,
14179 (Self::Brush(left), Self::Brush(right)) => left == right,
14180 (Self::ButtonStyle(left), Self::ButtonStyle(right)) => left == right,
14181 (Self::Color(left), Self::Color(right)) => left == right,
14182 (Self::CornerRadius(left), Self::CornerRadius(right)) => left == right,
14183 (Self::DragDropPolicy(left), Self::DragDropPolicy(right)) => left == right,
14184 (Self::Duration(left), Self::Duration(right)) => left == right,
14185 (Self::EncodedImage(left), Self::EncodedImage(right)) => left == right,
14186 (Self::F64(left), Self::F64(right)) => f64_eq(*left, *right),
14187 (Self::FontWeight(left), Self::FontWeight(right)) => left == right,
14188 (Self::GridLengths(left), Self::GridLengths(right)) => left == right,
14189 (Self::HorizontalAlignment(left), Self::HorizontalAlignment(right)) => left == right,
14190 (Self::I32(left), Self::I32(right)) => left == right,
14191 (Self::InfoBarSeverity(left), Self::InfoBarSeverity(right)) => left == right,
14192 (Self::KeyAccelerators(left), Self::KeyAccelerators(right)) => left == right,
14193 (Self::ListViewSelectionMode(left), Self::ListViewSelectionMode(right)) => {
14194 left == right
14195 }
14196 (
14197 Self::NavigationViewBackButtonVisible(left),
14198 Self::NavigationViewBackButtonVisible(right),
14199 ) => left == right,
14200 (
14201 Self::NavigationViewPaneDisplayMode(left),
14202 Self::NavigationViewPaneDisplayMode(right),
14203 ) => left == right,
14204 (Self::OptionalF64(left), Self::OptionalF64(right)) => match (left, right) {
14205 (Some(left), Some(right)) => f64_eq(*left, *right),
14206 (None, None) => true,
14207 _ => false,
14208 },
14209 (Self::Orientation(left), Self::Orientation(right)) => left == right,
14210 (Self::PasswordRevealMode(left), Self::PasswordRevealMode(right)) => left == right,
14211 (Self::ResourceOverrides(left), Self::ResourceOverrides(right)) => left == right,
14212 (Self::RichText(left), Self::RichText(right)) => left == right,
14213 (Self::ScrollBarVisibility(left), Self::ScrollBarVisibility(right)) => left == right,
14214 (
14215 Self::ScrollingScrollBarVisibility(left),
14216 Self::ScrollingScrollBarVisibility(right),
14217 ) => left == right,
14218 (Self::SelectionIndex(left), Self::SelectionIndex(right)) => left == right,
14219 (Self::SplitViewDisplayMode(left), Self::SplitViewDisplayMode(right)) => left == right,
14220 (Self::Str(left), Self::Str(right)) => left == right,
14221 (Self::StrList(left), Self::StrList(right)) => left == right,
14222 (Self::Stretch(left), Self::Stretch(right)) => left == right,
14223 (Self::Symbol(left), Self::Symbol(right)) => left == right,
14224 (Self::TeachingTipPlacementMode(left), Self::TeachingTipPlacementMode(right)) => {
14225 left == right
14226 }
14227 (Self::TextTrimming(left), Self::TextTrimming(right)) => left == right,
14228 (Self::TextWrapping(left), Self::TextWrapping(right)) => left == right,
14229 (Self::Thickness(left), Self::Thickness(right)) => left == right,
14230 (Self::TreeViewSelectionMode(left), Self::TreeViewSelectionMode(right)) => {
14231 left == right
14232 }
14233 (Self::VerticalAlignment(left), Self::VerticalAlignment(right)) => left == right,
14234 _ => false,
14235 }
14236 }
14237}
14238#[derive(Clone, Copy, Debug)]
14239pub enum PropertyValueRef<'a> {
14240 Bool(bool),
14241 Brush(Brush),
14242 ButtonStyle(ButtonStyle),
14243 Color(Color),
14244 CornerRadius(&'a CornerRadius),
14245 DragDropPolicy(&'a DragDropPolicy),
14246 Duration(std::time::Duration),
14247 EncodedImage(&'a EncodedImage),
14248 F64(f64),
14249 FontWeight(FontWeight),
14250 GridLengths(&'a std::rc::Rc<Vec<GridLength>>),
14251 HorizontalAlignment(HorizontalAlignment),
14252 I32(i32),
14253 InfoBarSeverity(InfoBarSeverity),
14254 KeyAccelerators(&'a KeyAccelerators),
14255 ListViewSelectionMode(ListViewSelectionMode),
14256 NavigationViewBackButtonVisible(NavigationViewBackButtonVisible),
14257 NavigationViewPaneDisplayMode(NavigationViewPaneDisplayMode),
14258 OptionalF64(Option<f64>),
14259 Orientation(Orientation),
14260 PasswordRevealMode(PasswordRevealMode),
14261 ResourceOverrides(&'a ResourceOverrides),
14262 RichText(&'a RichText),
14263 ScrollBarVisibility(ScrollBarVisibility),
14264 ScrollingScrollBarVisibility(ScrollingScrollBarVisibility),
14265 SelectionIndex(Option<usize>),
14266 SplitViewDisplayMode(SplitViewDisplayMode),
14267 Str(&'a str),
14268 StrList(&'a std::rc::Rc<Vec<String>>),
14269 Stretch(Stretch),
14270 Symbol(Symbol),
14271 TeachingTipPlacementMode(TeachingTipPlacementMode),
14272 TextTrimming(TextTrimming),
14273 TextWrapping(TextWrapping),
14274 Thickness(&'a Thickness),
14275 TreeViewSelectionMode(TreeViewSelectionMode),
14276 VerticalAlignment(VerticalAlignment),
14277}
14278impl PropertyValueRef<'_> {
14279 pub fn equals_owned(self, value: &PropertyValue) -> bool {
14280 match (self, value) {
14281 (Self::Bool(left), PropertyValue::Bool(right)) => left == *right,
14282 (Self::Brush(left), PropertyValue::Brush(right)) => left == *right,
14283 (Self::ButtonStyle(left), PropertyValue::ButtonStyle(right)) => left == *right,
14284 (Self::Color(left), PropertyValue::Color(right)) => left == *right,
14285 (Self::CornerRadius(left), PropertyValue::CornerRadius(right)) => left == right,
14286 (Self::DragDropPolicy(left), PropertyValue::DragDropPolicy(right)) => left == right,
14287 (Self::Duration(left), PropertyValue::Duration(right)) => left == *right,
14288 (Self::EncodedImage(left), PropertyValue::EncodedImage(right)) => left == right,
14289 (Self::F64(left), PropertyValue::F64(right)) => f64_eq(left, *right),
14290 (Self::FontWeight(left), PropertyValue::FontWeight(right)) => left == *right,
14291 (Self::GridLengths(left), PropertyValue::GridLengths(right)) => left == right,
14292 (Self::HorizontalAlignment(left), PropertyValue::HorizontalAlignment(right)) => {
14293 left == *right
14294 }
14295 (Self::I32(left), PropertyValue::I32(right)) => left == *right,
14296 (Self::InfoBarSeverity(left), PropertyValue::InfoBarSeverity(right)) => left == *right,
14297 (Self::KeyAccelerators(left), PropertyValue::KeyAccelerators(right)) => left == right,
14298 (Self::ListViewSelectionMode(left), PropertyValue::ListViewSelectionMode(right)) => {
14299 left == *right
14300 }
14301 (
14302 Self::NavigationViewBackButtonVisible(left),
14303 PropertyValue::NavigationViewBackButtonVisible(right),
14304 ) => left == *right,
14305 (
14306 Self::NavigationViewPaneDisplayMode(left),
14307 PropertyValue::NavigationViewPaneDisplayMode(right),
14308 ) => left == *right,
14309 (Self::OptionalF64(left), PropertyValue::OptionalF64(right)) => match (left, right) {
14310 (Some(left), Some(right)) => f64_eq(left, *right),
14311 (None, None) => true,
14312 _ => false,
14313 },
14314 (Self::Orientation(left), PropertyValue::Orientation(right)) => left == *right,
14315 (Self::PasswordRevealMode(left), PropertyValue::PasswordRevealMode(right)) => {
14316 left == *right
14317 }
14318 (Self::ResourceOverrides(left), PropertyValue::ResourceOverrides(right)) => {
14319 left == right
14320 }
14321 (Self::RichText(left), PropertyValue::RichText(right)) => left == right,
14322 (Self::ScrollBarVisibility(left), PropertyValue::ScrollBarVisibility(right)) => {
14323 left == *right
14324 }
14325 (
14326 Self::ScrollingScrollBarVisibility(left),
14327 PropertyValue::ScrollingScrollBarVisibility(right),
14328 ) => left == *right,
14329 (Self::SelectionIndex(left), PropertyValue::SelectionIndex(right)) => left == *right,
14330 (Self::SplitViewDisplayMode(left), PropertyValue::SplitViewDisplayMode(right)) => {
14331 left == *right
14332 }
14333 (Self::Str(left), PropertyValue::Str(right)) => left == right,
14334 (Self::StrList(left), PropertyValue::StrList(right)) => left == right,
14335 (Self::Stretch(left), PropertyValue::Stretch(right)) => left == *right,
14336 (Self::Symbol(left), PropertyValue::Symbol(right)) => left == *right,
14337 (
14338 Self::TeachingTipPlacementMode(left),
14339 PropertyValue::TeachingTipPlacementMode(right),
14340 ) => left == *right,
14341 (Self::TextTrimming(left), PropertyValue::TextTrimming(right)) => left == *right,
14342 (Self::TextWrapping(left), PropertyValue::TextWrapping(right)) => left == *right,
14343 (Self::Thickness(left), PropertyValue::Thickness(right)) => left == right,
14344 (Self::TreeViewSelectionMode(left), PropertyValue::TreeViewSelectionMode(right)) => {
14345 left == *right
14346 }
14347 (Self::VerticalAlignment(left), PropertyValue::VerticalAlignment(right)) => {
14348 left == *right
14349 }
14350 _ => false,
14351 }
14352 }
14353 pub fn into_owned(self) -> PropertyValue {
14354 match self {
14355 Self::Bool(value) => PropertyValue::Bool(value),
14356 Self::Brush(value) => PropertyValue::Brush(value),
14357 Self::ButtonStyle(value) => PropertyValue::ButtonStyle(value),
14358 Self::Color(value) => PropertyValue::Color(value),
14359 Self::CornerRadius(value) => PropertyValue::CornerRadius(value.clone()),
14360 Self::DragDropPolicy(value) => PropertyValue::DragDropPolicy(value.clone()),
14361 Self::Duration(value) => PropertyValue::Duration(value),
14362 Self::EncodedImage(value) => PropertyValue::EncodedImage(value.clone()),
14363 Self::F64(value) => PropertyValue::F64(value),
14364 Self::FontWeight(value) => PropertyValue::FontWeight(value),
14365 Self::GridLengths(value) => PropertyValue::GridLengths(value.clone()),
14366 Self::HorizontalAlignment(value) => PropertyValue::HorizontalAlignment(value),
14367 Self::I32(value) => PropertyValue::I32(value),
14368 Self::InfoBarSeverity(value) => PropertyValue::InfoBarSeverity(value),
14369 Self::KeyAccelerators(value) => PropertyValue::KeyAccelerators(value.clone()),
14370 Self::ListViewSelectionMode(value) => PropertyValue::ListViewSelectionMode(value),
14371 Self::NavigationViewBackButtonVisible(value) => {
14372 PropertyValue::NavigationViewBackButtonVisible(value)
14373 }
14374 Self::NavigationViewPaneDisplayMode(value) => {
14375 PropertyValue::NavigationViewPaneDisplayMode(value)
14376 }
14377 Self::OptionalF64(value) => PropertyValue::OptionalF64(value),
14378 Self::Orientation(value) => PropertyValue::Orientation(value),
14379 Self::PasswordRevealMode(value) => PropertyValue::PasswordRevealMode(value),
14380 Self::ResourceOverrides(value) => PropertyValue::ResourceOverrides(value.clone()),
14381 Self::RichText(value) => PropertyValue::RichText(value.clone()),
14382 Self::ScrollBarVisibility(value) => PropertyValue::ScrollBarVisibility(value),
14383 Self::ScrollingScrollBarVisibility(value) => {
14384 PropertyValue::ScrollingScrollBarVisibility(value)
14385 }
14386 Self::SelectionIndex(value) => PropertyValue::SelectionIndex(value),
14387 Self::SplitViewDisplayMode(value) => PropertyValue::SplitViewDisplayMode(value),
14388 Self::Str(value) => PropertyValue::Str(value.to_string()),
14389 Self::StrList(value) => PropertyValue::StrList(value.clone()),
14390 Self::Stretch(value) => PropertyValue::Stretch(value),
14391 Self::Symbol(value) => PropertyValue::Symbol(value),
14392 Self::TeachingTipPlacementMode(value) => PropertyValue::TeachingTipPlacementMode(value),
14393 Self::TextTrimming(value) => PropertyValue::TextTrimming(value),
14394 Self::TextWrapping(value) => PropertyValue::TextWrapping(value),
14395 Self::Thickness(value) => PropertyValue::Thickness(value.clone()),
14396 Self::TreeViewSelectionMode(value) => PropertyValue::TreeViewSelectionMode(value),
14397 Self::VerticalAlignment(value) => PropertyValue::VerticalAlignment(value),
14398 }
14399 }
14400}
14401impl From<bool> for PropertyValue {
14402 fn from(value: bool) -> Self {
14403 Self::Bool(value)
14404 }
14405}
14406impl From<Brush> for PropertyValue {
14407 fn from(value: Brush) -> Self {
14408 Self::Brush(value)
14409 }
14410}
14411impl From<ButtonStyle> for PropertyValue {
14412 fn from(value: ButtonStyle) -> Self {
14413 Self::ButtonStyle(value)
14414 }
14415}
14416impl From<Color> for PropertyValue {
14417 fn from(value: Color) -> Self {
14418 Self::Color(value)
14419 }
14420}
14421impl From<CornerRadius> for PropertyValue {
14422 fn from(value: CornerRadius) -> Self {
14423 Self::CornerRadius(value)
14424 }
14425}
14426impl From<DragDropPolicy> for PropertyValue {
14427 fn from(value: DragDropPolicy) -> Self {
14428 Self::DragDropPolicy(value)
14429 }
14430}
14431impl From<std::time::Duration> for PropertyValue {
14432 fn from(value: std::time::Duration) -> Self {
14433 Self::Duration(value)
14434 }
14435}
14436impl From<EncodedImage> for PropertyValue {
14437 fn from(value: EncodedImage) -> Self {
14438 Self::EncodedImage(value)
14439 }
14440}
14441impl From<f64> for PropertyValue {
14442 fn from(value: f64) -> Self {
14443 Self::F64(value)
14444 }
14445}
14446impl From<FontWeight> for PropertyValue {
14447 fn from(value: FontWeight) -> Self {
14448 Self::FontWeight(value)
14449 }
14450}
14451impl From<std::rc::Rc<Vec<GridLength>>> for PropertyValue {
14452 fn from(value: std::rc::Rc<Vec<GridLength>>) -> Self {
14453 Self::GridLengths(value)
14454 }
14455}
14456impl From<HorizontalAlignment> for PropertyValue {
14457 fn from(value: HorizontalAlignment) -> Self {
14458 Self::HorizontalAlignment(value)
14459 }
14460}
14461impl From<i32> for PropertyValue {
14462 fn from(value: i32) -> Self {
14463 Self::I32(value)
14464 }
14465}
14466impl From<InfoBarSeverity> for PropertyValue {
14467 fn from(value: InfoBarSeverity) -> Self {
14468 Self::InfoBarSeverity(value)
14469 }
14470}
14471impl From<KeyAccelerators> for PropertyValue {
14472 fn from(value: KeyAccelerators) -> Self {
14473 Self::KeyAccelerators(value)
14474 }
14475}
14476impl From<ListViewSelectionMode> for PropertyValue {
14477 fn from(value: ListViewSelectionMode) -> Self {
14478 Self::ListViewSelectionMode(value)
14479 }
14480}
14481impl From<NavigationViewBackButtonVisible> for PropertyValue {
14482 fn from(value: NavigationViewBackButtonVisible) -> Self {
14483 Self::NavigationViewBackButtonVisible(value)
14484 }
14485}
14486impl From<NavigationViewPaneDisplayMode> for PropertyValue {
14487 fn from(value: NavigationViewPaneDisplayMode) -> Self {
14488 Self::NavigationViewPaneDisplayMode(value)
14489 }
14490}
14491impl From<Option<f64>> for PropertyValue {
14492 fn from(value: Option<f64>) -> Self {
14493 Self::OptionalF64(value)
14494 }
14495}
14496impl From<Orientation> for PropertyValue {
14497 fn from(value: Orientation) -> Self {
14498 Self::Orientation(value)
14499 }
14500}
14501impl From<PasswordRevealMode> for PropertyValue {
14502 fn from(value: PasswordRevealMode) -> Self {
14503 Self::PasswordRevealMode(value)
14504 }
14505}
14506impl From<ResourceOverrides> for PropertyValue {
14507 fn from(value: ResourceOverrides) -> Self {
14508 Self::ResourceOverrides(value)
14509 }
14510}
14511impl From<RichText> for PropertyValue {
14512 fn from(value: RichText) -> Self {
14513 Self::RichText(value)
14514 }
14515}
14516impl From<ScrollBarVisibility> for PropertyValue {
14517 fn from(value: ScrollBarVisibility) -> Self {
14518 Self::ScrollBarVisibility(value)
14519 }
14520}
14521impl From<ScrollingScrollBarVisibility> for PropertyValue {
14522 fn from(value: ScrollingScrollBarVisibility) -> Self {
14523 Self::ScrollingScrollBarVisibility(value)
14524 }
14525}
14526impl From<Option<usize>> for PropertyValue {
14527 fn from(value: Option<usize>) -> Self {
14528 Self::SelectionIndex(value)
14529 }
14530}
14531impl From<SplitViewDisplayMode> for PropertyValue {
14532 fn from(value: SplitViewDisplayMode) -> Self {
14533 Self::SplitViewDisplayMode(value)
14534 }
14535}
14536impl From<String> for PropertyValue {
14537 fn from(value: String) -> Self {
14538 Self::Str(value)
14539 }
14540}
14541impl From<std::rc::Rc<Vec<String>>> for PropertyValue {
14542 fn from(value: std::rc::Rc<Vec<String>>) -> Self {
14543 Self::StrList(value)
14544 }
14545}
14546impl From<Stretch> for PropertyValue {
14547 fn from(value: Stretch) -> Self {
14548 Self::Stretch(value)
14549 }
14550}
14551impl From<Symbol> for PropertyValue {
14552 fn from(value: Symbol) -> Self {
14553 Self::Symbol(value)
14554 }
14555}
14556impl From<TeachingTipPlacementMode> for PropertyValue {
14557 fn from(value: TeachingTipPlacementMode) -> Self {
14558 Self::TeachingTipPlacementMode(value)
14559 }
14560}
14561impl From<TextTrimming> for PropertyValue {
14562 fn from(value: TextTrimming) -> Self {
14563 Self::TextTrimming(value)
14564 }
14565}
14566impl From<TextWrapping> for PropertyValue {
14567 fn from(value: TextWrapping) -> Self {
14568 Self::TextWrapping(value)
14569 }
14570}
14571impl From<Thickness> for PropertyValue {
14572 fn from(value: Thickness) -> Self {
14573 Self::Thickness(value)
14574 }
14575}
14576impl From<TreeViewSelectionMode> for PropertyValue {
14577 fn from(value: TreeViewSelectionMode) -> Self {
14578 Self::TreeViewSelectionMode(value)
14579 }
14580}
14581impl From<VerticalAlignment> for PropertyValue {
14582 fn from(value: VerticalAlignment) -> Self {
14583 Self::VerticalAlignment(value)
14584 }
14585}
14586#[derive(Clone, Debug, PartialEq)]
14587pub struct SelectionChange {
14588 pub item: Option<crate::core::NodeId>,
14589 pub tag: Option<String>,
14590}
14591#[derive(Clone, Debug)]
14592pub enum EventPayload {
14593 Bool(bool),
14594 Color(Color),
14595 ContentDialogResult(ContentDialogResult),
14596 DragKind(DragKind),
14597 DroppedData(DroppedData),
14598 F64(f64),
14599 NavigationViewDisplayMode(NavigationViewDisplayMode),
14600 OptionalDateTime(Option<windows_time::DateTime>),
14601 OptionalF64(Option<f64>),
14602 OptionalTimeSpan(Option<windows_time::TimeSpan>),
14603 PointerEventInfo(PointerEventInfo),
14604 SelectionChange(SelectionChange),
14605 SelectionIndex(Option<usize>),
14606 Str(String),
14607 StrList(std::rc::Rc<Vec<String>>),
14608 String(String),
14609 Unit,
14610}
14611impl PartialEq for EventPayload {
14612 fn eq(&self, other: &Self) -> bool {
14613 match (self, other) {
14614 (Self::Bool(left), Self::Bool(right)) => left == right,
14615 (Self::Color(left), Self::Color(right)) => left == right,
14616 (Self::ContentDialogResult(left), Self::ContentDialogResult(right)) => left == right,
14617 (Self::DragKind(left), Self::DragKind(right)) => left == right,
14618 (Self::DroppedData(left), Self::DroppedData(right)) => left == right,
14619 (Self::F64(left), Self::F64(right)) => f64_eq(*left, *right),
14620 (Self::NavigationViewDisplayMode(left), Self::NavigationViewDisplayMode(right)) => {
14621 left == right
14622 }
14623 (Self::OptionalDateTime(left), Self::OptionalDateTime(right)) => left == right,
14624 (Self::OptionalF64(left), Self::OptionalF64(right)) => match (left, right) {
14625 (Some(left), Some(right)) => f64_eq(*left, *right),
14626 (None, None) => true,
14627 _ => false,
14628 },
14629 (Self::OptionalTimeSpan(left), Self::OptionalTimeSpan(right)) => left == right,
14630 (Self::PointerEventInfo(left), Self::PointerEventInfo(right)) => left == right,
14631 (Self::SelectionChange(left), Self::SelectionChange(right)) => left == right,
14632 (Self::SelectionIndex(left), Self::SelectionIndex(right)) => left == right,
14633 (Self::Str(left), Self::Str(right)) => left == right,
14634 (Self::StrList(left), Self::StrList(right)) => left == right,
14635 (Self::String(left), Self::String(right)) => left == right,
14636 (Self::Unit, Self::Unit) => true,
14637 _ => false,
14638 }
14639 }
14640}
14641#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14642pub enum ControlRole {
14643 Leaf,
14644 Content,
14645 Children,
14646 Slots,
14647 Virtual,
14648}
14649#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14650pub enum Capability {
14651 Layout,
14652 TextStyle,
14653 Enabled,
14654 Content,
14655 Children,
14656 ControlledText,
14657 Items,
14658 Focus,
14659 Reference,
14660 GridDefinitions,
14661 WindowTitleBar,
14662}
14663#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14664pub struct PropertyDescriptor {
14665 pub id: PropertyId,
14666 pub name: &'static str,
14667 pub field: &'static str,
14668 pub value: &'static str,
14669 pub interface: &'static str,
14670 pub clearable: bool,
14671 pub feedback: Option<&'static str>,
14672 pub feedback_contract: Option<&'static str>,
14673 pub observes_feedback: bool,
14674}
14675#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14676pub struct EventDescriptor {
14677 pub id: EventId,
14678 pub name: &'static str,
14679 pub field: &'static str,
14680 pub payload: &'static str,
14681 pub interface: &'static str,
14682}
14683#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14684pub struct SlotDescriptor {
14685 pub id: SlotId,
14686 pub name: &'static str,
14687 pub interface: &'static str,
14688 pub target: &'static str,
14689 pub collection: bool,
14690}
14691#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14692pub struct SelectionDescriptor {
14693 pub slot: SlotId,
14694 pub item: MountedKind,
14695 pub selected_property: PropertyId,
14696 pub event: EventId,
14697 pub payload_property: PropertyId,
14698}
14699#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14700pub struct ControlledCollectionDescriptor {
14701 pub slot: SlotId,
14702 pub property: PropertyId,
14703 pub event: EventId,
14704}
14705#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14706pub struct ControlDescriptor {
14707 pub kind: MountedKind,
14708 pub name: &'static str,
14709 pub type_name: &'static str,
14710 pub role: ControlRole,
14711 pub capabilities: &'static [Capability],
14712 pub properties: &'static [PropertyDescriptor],
14713 pub events: &'static [EventDescriptor],
14714 pub slots: &'static [SlotDescriptor],
14715 pub selection: Option<SelectionDescriptor>,
14716 pub controlled_collection: Option<ControlledCollectionDescriptor>,
14717}
14718const TEXT_BLOCK_PROPERTIES: &[PropertyDescriptor] = &[
14719 PropertyDescriptor {
14720 id: PropertyId::TextBlockText,
14721 name: "Text",
14722 field: "text",
14723 value: "Str",
14724 interface: "Microsoft.UI.Xaml.Controls.ITextBlock",
14725 clearable: true,
14726 feedback: None,
14727 feedback_contract: None,
14728 observes_feedback: false,
14729 },
14730 PropertyDescriptor {
14731 id: PropertyId::TextBlockTextWrapping,
14732 name: "TextWrapping",
14733 field: "text_wrapping",
14734 value: "TextWrapping",
14735 interface: "Microsoft.UI.Xaml.Controls.ITextBlock",
14736 clearable: true,
14737 feedback: None,
14738 feedback_contract: None,
14739 observes_feedback: false,
14740 },
14741 PropertyDescriptor {
14742 id: PropertyId::TextBlockFontSize,
14743 name: "FontSize",
14744 field: "font_size",
14745 value: "F64",
14746 interface: "Microsoft.UI.Xaml.Controls.ITextBlock",
14747 clearable: true,
14748 feedback: None,
14749 feedback_contract: None,
14750 observes_feedback: false,
14751 },
14752 PropertyDescriptor {
14753 id: PropertyId::TextBlockFontWeight,
14754 name: "FontWeight",
14755 field: "font_weight",
14756 value: "FontWeight",
14757 interface: "Microsoft.UI.Xaml.Controls.ITextBlock",
14758 clearable: true,
14759 feedback: None,
14760 feedback_contract: None,
14761 observes_feedback: false,
14762 },
14763 PropertyDescriptor {
14764 id: PropertyId::TextBlockIsTextSelectionEnabled,
14765 name: "IsTextSelectionEnabled",
14766 field: "is_text_selection_enabled",
14767 value: "Bool",
14768 interface: "Microsoft.UI.Xaml.Controls.ITextBlock",
14769 clearable: true,
14770 feedback: None,
14771 feedback_contract: None,
14772 observes_feedback: false,
14773 },
14774 PropertyDescriptor {
14775 id: PropertyId::TextBlockMaxLines,
14776 name: "MaxLines",
14777 field: "max_lines",
14778 value: "I32",
14779 interface: "Microsoft.UI.Xaml.Controls.ITextBlock",
14780 clearable: true,
14781 feedback: None,
14782 feedback_contract: None,
14783 observes_feedback: false,
14784 },
14785 PropertyDescriptor {
14786 id: PropertyId::TextBlockTextTrimming,
14787 name: "TextTrimming",
14788 field: "text_trimming",
14789 value: "TextTrimming",
14790 interface: "Microsoft.UI.Xaml.Controls.ITextBlock",
14791 clearable: true,
14792 feedback: None,
14793 feedback_contract: None,
14794 observes_feedback: false,
14795 },
14796 PropertyDescriptor {
14797 id: PropertyId::TextBlockForeground,
14798 name: "Foreground",
14799 field: "foreground",
14800 value: "Brush",
14801 interface: "Microsoft.UI.Xaml.Controls.ITextBlock",
14802 clearable: true,
14803 feedback: None,
14804 feedback_contract: None,
14805 observes_feedback: false,
14806 },
14807];
14808const TEXT_BLOCK_EVENTS: &[EventDescriptor] = &[];
14809const TEXT_BLOCK_SLOTS: &[SlotDescriptor] = &[];
14810const BUTTON_PROPERTIES: &[PropertyDescriptor] = &[
14811 PropertyDescriptor {
14812 id: PropertyId::ButtonIsEnabled,
14813 name: "IsEnabled",
14814 field: "is_enabled",
14815 value: "Bool",
14816 interface: "Microsoft.UI.Xaml.Controls.IControl",
14817 clearable: true,
14818 feedback: None,
14819 feedback_contract: None,
14820 observes_feedback: false,
14821 },
14822 PropertyDescriptor {
14823 id: PropertyId::ButtonHorizontalContentAlignment,
14824 name: "HorizontalContentAlignment",
14825 field: "horizontal_content_alignment",
14826 value: "HorizontalAlignment",
14827 interface: "Microsoft.UI.Xaml.Controls.IControl",
14828 clearable: true,
14829 feedback: None,
14830 feedback_contract: None,
14831 observes_feedback: false,
14832 },
14833 PropertyDescriptor {
14834 id: PropertyId::ButtonVerticalContentAlignment,
14835 name: "VerticalContentAlignment",
14836 field: "vertical_content_alignment",
14837 value: "VerticalAlignment",
14838 interface: "Microsoft.UI.Xaml.Controls.IControl",
14839 clearable: true,
14840 feedback: None,
14841 feedback_contract: None,
14842 observes_feedback: false,
14843 },
14844 PropertyDescriptor {
14845 id: PropertyId::ButtonResources,
14846 name: "Resources",
14847 field: "resource_overrides",
14848 value: "ResourceOverrides",
14849 interface: "Microsoft.UI.Xaml.IFrameworkElement",
14850 clearable: true,
14851 feedback: None,
14852 feedback_contract: None,
14853 observes_feedback: false,
14854 },
14855 PropertyDescriptor {
14856 id: PropertyId::ButtonStyle,
14857 name: "Style",
14858 field: "style",
14859 value: "ButtonStyle",
14860 interface: "Microsoft.UI.Xaml.IFrameworkElement",
14861 clearable: true,
14862 feedback: None,
14863 feedback_contract: None,
14864 observes_feedback: false,
14865 },
14866 PropertyDescriptor {
14867 id: PropertyId::ButtonKeyboardAccelerators,
14868 name: "KeyboardAccelerators",
14869 field: "key_accelerators",
14870 value: "KeyAccelerators",
14871 interface: "Microsoft.UI.Xaml.IUIElement",
14872 clearable: true,
14873 feedback: None,
14874 feedback_contract: None,
14875 observes_feedback: false,
14876 },
14877];
14878const BUTTON_EVENTS: &[EventDescriptor] = &[EventDescriptor {
14879 id: EventId::ButtonClick,
14880 name: "Click",
14881 field: "on_click",
14882 payload: "Unit",
14883 interface: "Microsoft.UI.Xaml.Controls.Primitives.IButtonBase",
14884}];
14885const BUTTON_SLOTS: &[SlotDescriptor] = &[];
14886const HYPERLINK_BUTTON_PROPERTIES: &[PropertyDescriptor] = &[
14887 PropertyDescriptor {
14888 id: PropertyId::HyperlinkButtonNavigateUri,
14889 name: "NavigateUri",
14890 field: "navigate_uri",
14891 value: "Str",
14892 interface: "Microsoft.UI.Xaml.Controls.IHyperlinkButton",
14893 clearable: true,
14894 feedback: None,
14895 feedback_contract: None,
14896 observes_feedback: false,
14897 },
14898 PropertyDescriptor {
14899 id: PropertyId::HyperlinkButtonIsEnabled,
14900 name: "IsEnabled",
14901 field: "is_enabled",
14902 value: "Bool",
14903 interface: "Microsoft.UI.Xaml.Controls.IControl",
14904 clearable: true,
14905 feedback: None,
14906 feedback_contract: None,
14907 observes_feedback: false,
14908 },
14909];
14910const HYPERLINK_BUTTON_EVENTS: &[EventDescriptor] = &[EventDescriptor {
14911 id: EventId::HyperlinkButtonClick,
14912 name: "Click",
14913 field: "on_click",
14914 payload: "Unit",
14915 interface: "Microsoft.UI.Xaml.Controls.Primitives.IButtonBase",
14916}];
14917const HYPERLINK_BUTTON_SLOTS: &[SlotDescriptor] = &[];
14918const REPEAT_BUTTON_PROPERTIES: &[PropertyDescriptor] = &[
14919 PropertyDescriptor {
14920 id: PropertyId::RepeatButtonDelay,
14921 name: "Delay",
14922 field: "delay",
14923 value: "I32",
14924 interface: "Microsoft.UI.Xaml.Controls.Primitives.IRepeatButton",
14925 clearable: true,
14926 feedback: None,
14927 feedback_contract: None,
14928 observes_feedback: false,
14929 },
14930 PropertyDescriptor {
14931 id: PropertyId::RepeatButtonInterval,
14932 name: "Interval",
14933 field: "interval",
14934 value: "I32",
14935 interface: "Microsoft.UI.Xaml.Controls.Primitives.IRepeatButton",
14936 clearable: true,
14937 feedback: None,
14938 feedback_contract: None,
14939 observes_feedback: false,
14940 },
14941 PropertyDescriptor {
14942 id: PropertyId::RepeatButtonIsEnabled,
14943 name: "IsEnabled",
14944 field: "is_enabled",
14945 value: "Bool",
14946 interface: "Microsoft.UI.Xaml.Controls.IControl",
14947 clearable: true,
14948 feedback: None,
14949 feedback_contract: None,
14950 observes_feedback: false,
14951 },
14952];
14953const REPEAT_BUTTON_EVENTS: &[EventDescriptor] = &[EventDescriptor {
14954 id: EventId::RepeatButtonClick,
14955 name: "Click",
14956 field: "on_click",
14957 payload: "Unit",
14958 interface: "Microsoft.UI.Xaml.Controls.Primitives.IButtonBase",
14959}];
14960const REPEAT_BUTTON_SLOTS: &[SlotDescriptor] = &[];
14961const BORDER_PROPERTIES: &[PropertyDescriptor] = &[
14962 PropertyDescriptor {
14963 id: PropertyId::BorderPadding,
14964 name: "Padding",
14965 field: "padding",
14966 value: "Thickness",
14967 interface: "Microsoft.UI.Xaml.Controls.IBorder",
14968 clearable: true,
14969 feedback: None,
14970 feedback_contract: None,
14971 observes_feedback: false,
14972 },
14973 PropertyDescriptor {
14974 id: PropertyId::BorderBorderThickness,
14975 name: "BorderThickness",
14976 field: "border_thickness",
14977 value: "Thickness",
14978 interface: "Microsoft.UI.Xaml.Controls.IBorder",
14979 clearable: true,
14980 feedback: None,
14981 feedback_contract: None,
14982 observes_feedback: false,
14983 },
14984 PropertyDescriptor {
14985 id: PropertyId::BorderCornerRadius,
14986 name: "CornerRadius",
14987 field: "corner_radius",
14988 value: "CornerRadius",
14989 interface: "Microsoft.UI.Xaml.Controls.IBorder",
14990 clearable: true,
14991 feedback: None,
14992 feedback_contract: None,
14993 observes_feedback: false,
14994 },
14995 PropertyDescriptor {
14996 id: PropertyId::BorderBackground,
14997 name: "Background",
14998 field: "background",
14999 value: "Brush",
15000 interface: "Microsoft.UI.Xaml.Controls.IBorder",
15001 clearable: true,
15002 feedback: None,
15003 feedback_contract: None,
15004 observes_feedback: false,
15005 },
15006 PropertyDescriptor {
15007 id: PropertyId::BorderBorderBrush,
15008 name: "BorderBrush",
15009 field: "border_brush",
15010 value: "Brush",
15011 interface: "Microsoft.UI.Xaml.Controls.IBorder",
15012 clearable: true,
15013 feedback: None,
15014 feedback_contract: None,
15015 observes_feedback: false,
15016 },
15017 PropertyDescriptor {
15018 id: PropertyId::BorderOpacityTransition,
15019 name: "OpacityTransition",
15020 field: "opacity_transition",
15021 value: "Duration",
15022 interface: "Microsoft.UI.Xaml.IUIElement",
15023 clearable: true,
15024 feedback: None,
15025 feedback_contract: None,
15026 observes_feedback: false,
15027 },
15028 PropertyDescriptor {
15029 id: PropertyId::BorderScale,
15030 name: "Scale",
15031 field: "scale",
15032 value: "F64",
15033 interface: "Microsoft.UI.Xaml.IUIElement",
15034 clearable: true,
15035 feedback: None,
15036 feedback_contract: None,
15037 observes_feedback: false,
15038 },
15039 PropertyDescriptor {
15040 id: PropertyId::BorderScaleTransition,
15041 name: "ScaleTransition",
15042 field: "scale_transition",
15043 value: "Duration",
15044 interface: "Microsoft.UI.Xaml.IUIElement",
15045 clearable: true,
15046 feedback: None,
15047 feedback_contract: None,
15048 observes_feedback: false,
15049 },
15050 PropertyDescriptor {
15051 id: PropertyId::BorderCapturePointerOnPress,
15052 name: "CapturePointerOnPress",
15053 field: "capture_pointer_on_press",
15054 value: "Bool",
15055 interface: "Microsoft.UI.Xaml.IUIElement",
15056 clearable: true,
15057 feedback: None,
15058 feedback_contract: None,
15059 observes_feedback: false,
15060 },
15061 PropertyDescriptor {
15062 id: PropertyId::BorderAllowDrop,
15063 name: "AllowDrop",
15064 field: "drop_policy",
15065 value: "DragDropPolicy",
15066 interface: "Microsoft.UI.Xaml.IUIElement",
15067 clearable: true,
15068 feedback: None,
15069 feedback_contract: None,
15070 observes_feedback: false,
15071 },
15072];
15073const BORDER_EVENTS: &[EventDescriptor] = &[
15074 EventDescriptor {
15075 id: EventId::BorderDragEnter,
15076 name: "DragEnter",
15077 field: "on_drag_enter",
15078 payload: "DragKind",
15079 interface: "Microsoft.UI.Xaml.IUIElement",
15080 },
15081 EventDescriptor {
15082 id: EventId::BorderDragOver,
15083 name: "DragOver",
15084 field: "on_drag_over",
15085 payload: "DragKind",
15086 interface: "Microsoft.UI.Xaml.IUIElement",
15087 },
15088 EventDescriptor {
15089 id: EventId::BorderDragLeave,
15090 name: "DragLeave",
15091 field: "on_drag_leave",
15092 payload: "Unit",
15093 interface: "Microsoft.UI.Xaml.IUIElement",
15094 },
15095 EventDescriptor {
15096 id: EventId::BorderDrop,
15097 name: "Drop",
15098 field: "on_drop",
15099 payload: "DroppedData",
15100 interface: "Microsoft.UI.Xaml.IUIElement",
15101 },
15102 EventDescriptor {
15103 id: EventId::BorderPointerPressed,
15104 name: "PointerPressed",
15105 field: "on_pointer_pressed",
15106 payload: "PointerEventInfo",
15107 interface: "Microsoft.UI.Xaml.IUIElement",
15108 },
15109 EventDescriptor {
15110 id: EventId::BorderPointerMoved,
15111 name: "PointerMoved",
15112 field: "on_pointer_moved",
15113 payload: "PointerEventInfo",
15114 interface: "Microsoft.UI.Xaml.IUIElement",
15115 },
15116 EventDescriptor {
15117 id: EventId::BorderPointerEntered,
15118 name: "PointerEntered",
15119 field: "on_pointer_entered",
15120 payload: "PointerEventInfo",
15121 interface: "Microsoft.UI.Xaml.IUIElement",
15122 },
15123 EventDescriptor {
15124 id: EventId::BorderPointerExited,
15125 name: "PointerExited",
15126 field: "on_pointer_exited",
15127 payload: "PointerEventInfo",
15128 interface: "Microsoft.UI.Xaml.IUIElement",
15129 },
15130 EventDescriptor {
15131 id: EventId::BorderPointerReleased,
15132 name: "PointerReleased",
15133 field: "on_pointer_released",
15134 payload: "PointerEventInfo",
15135 interface: "Microsoft.UI.Xaml.IUIElement",
15136 },
15137 EventDescriptor {
15138 id: EventId::BorderPointerCaptureLost,
15139 name: "PointerCaptureLost",
15140 field: "on_pointer_capture_lost",
15141 payload: "Unit",
15142 interface: "Microsoft.UI.Xaml.IUIElement",
15143 },
15144 EventDescriptor {
15145 id: EventId::BorderPointerCanceled,
15146 name: "PointerCanceled",
15147 field: "on_pointer_canceled",
15148 payload: "Unit",
15149 interface: "Microsoft.UI.Xaml.IUIElement",
15150 },
15151];
15152const BORDER_SLOTS: &[SlotDescriptor] = &[];
15153const BREADCRUMB_BAR_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
15154 id: PropertyId::BreadcrumbBarItemsSource,
15155 name: "ItemsSource",
15156 field: "items_source",
15157 value: "StrList",
15158 interface: "Microsoft.UI.Xaml.Controls.IBreadcrumbBar",
15159 clearable: true,
15160 feedback: None,
15161 feedback_contract: None,
15162 observes_feedback: false,
15163}];
15164const BREADCRUMB_BAR_EVENTS: &[EventDescriptor] = &[EventDescriptor {
15165 id: EventId::BreadcrumbBarItemClicked,
15166 name: "ItemClicked",
15167 field: "on_item_clicked",
15168 payload: "Str",
15169 interface: "Microsoft.UI.Xaml.Controls.IBreadcrumbBar",
15170}];
15171const BREADCRUMB_BAR_SLOTS: &[SlotDescriptor] = &[];
15172const STACK_PANEL_PROPERTIES: &[PropertyDescriptor] = &[
15173 PropertyDescriptor {
15174 id: PropertyId::StackPanelOrientation,
15175 name: "Orientation",
15176 field: "orientation",
15177 value: "Orientation",
15178 interface: "Microsoft.UI.Xaml.Controls.IStackPanel",
15179 clearable: true,
15180 feedback: None,
15181 feedback_contract: None,
15182 observes_feedback: false,
15183 },
15184 PropertyDescriptor {
15185 id: PropertyId::StackPanelSpacing,
15186 name: "Spacing",
15187 field: "spacing",
15188 value: "F64",
15189 interface: "Microsoft.UI.Xaml.Controls.IStackPanel",
15190 clearable: true,
15191 feedback: None,
15192 feedback_contract: None,
15193 observes_feedback: false,
15194 },
15195];
15196const STACK_PANEL_EVENTS: &[EventDescriptor] = &[];
15197const STACK_PANEL_SLOTS: &[SlotDescriptor] = &[];
15198const VARIABLE_SIZED_WRAP_GRID_PROPERTIES: &[PropertyDescriptor] = &[
15199 PropertyDescriptor {
15200 id: PropertyId::VariableSizedWrapGridItemWidth,
15201 name: "ItemWidth",
15202 field: "item_width",
15203 value: "F64",
15204 interface: "Microsoft.UI.Xaml.Controls.IVariableSizedWrapGrid",
15205 clearable: true,
15206 feedback: None,
15207 feedback_contract: None,
15208 observes_feedback: false,
15209 },
15210 PropertyDescriptor {
15211 id: PropertyId::VariableSizedWrapGridItemHeight,
15212 name: "ItemHeight",
15213 field: "item_height",
15214 value: "F64",
15215 interface: "Microsoft.UI.Xaml.Controls.IVariableSizedWrapGrid",
15216 clearable: true,
15217 feedback: None,
15218 feedback_contract: None,
15219 observes_feedback: false,
15220 },
15221 PropertyDescriptor {
15222 id: PropertyId::VariableSizedWrapGridOrientation,
15223 name: "Orientation",
15224 field: "orientation",
15225 value: "Orientation",
15226 interface: "Microsoft.UI.Xaml.Controls.IVariableSizedWrapGrid",
15227 clearable: true,
15228 feedback: None,
15229 feedback_contract: None,
15230 observes_feedback: false,
15231 },
15232];
15233const VARIABLE_SIZED_WRAP_GRID_EVENTS: &[EventDescriptor] = &[];
15234const VARIABLE_SIZED_WRAP_GRID_SLOTS: &[SlotDescriptor] = &[];
15235const GRID_PROPERTIES: &[PropertyDescriptor] = &[
15236 PropertyDescriptor {
15237 id: PropertyId::GridRowSpacing,
15238 name: "RowSpacing",
15239 field: "row_spacing",
15240 value: "F64",
15241 interface: "Microsoft.UI.Xaml.Controls.IGrid",
15242 clearable: true,
15243 feedback: None,
15244 feedback_contract: None,
15245 observes_feedback: false,
15246 },
15247 PropertyDescriptor {
15248 id: PropertyId::GridColumnSpacing,
15249 name: "ColumnSpacing",
15250 field: "column_spacing",
15251 value: "F64",
15252 interface: "Microsoft.UI.Xaml.Controls.IGrid",
15253 clearable: true,
15254 feedback: None,
15255 feedback_contract: None,
15256 observes_feedback: false,
15257 },
15258 PropertyDescriptor {
15259 id: PropertyId::GridKeyboardAccelerators,
15260 name: "KeyboardAccelerators",
15261 field: "key_accelerators",
15262 value: "KeyAccelerators",
15263 interface: "Microsoft.UI.Xaml.IUIElement",
15264 clearable: true,
15265 feedback: None,
15266 feedback_contract: None,
15267 observes_feedback: false,
15268 },
15269 PropertyDescriptor {
15270 id: PropertyId::GridBackground,
15271 name: "Background",
15272 field: "background",
15273 value: "Brush",
15274 interface: "Microsoft.UI.Xaml.Controls.IPanel",
15275 clearable: true,
15276 feedback: None,
15277 feedback_contract: None,
15278 observes_feedback: false,
15279 },
15280];
15281const GRID_EVENTS: &[EventDescriptor] = &[];
15282const GRID_SLOTS: &[SlotDescriptor] = &[];
15283const TEXT_BOX_PROPERTIES: &[PropertyDescriptor] = &[
15284 PropertyDescriptor {
15285 id: PropertyId::TextBoxText,
15286 name: "Text",
15287 field: "text",
15288 value: "Str",
15289 interface: "Microsoft.UI.Xaml.Controls.ITextBox",
15290 clearable: true,
15291 feedback: Some("TextChanged"),
15292 feedback_contract: Some("synchronous_exact"),
15293 observes_feedback: true,
15294 },
15295 PropertyDescriptor {
15296 id: PropertyId::TextBoxPlaceholderText,
15297 name: "PlaceholderText",
15298 field: "placeholder_text",
15299 value: "Str",
15300 interface: "Microsoft.UI.Xaml.Controls.ITextBox",
15301 clearable: true,
15302 feedback: None,
15303 feedback_contract: None,
15304 observes_feedback: false,
15305 },
15306 PropertyDescriptor {
15307 id: PropertyId::TextBoxIsEnabled,
15308 name: "IsEnabled",
15309 field: "is_enabled",
15310 value: "Bool",
15311 interface: "Microsoft.UI.Xaml.Controls.IControl",
15312 clearable: true,
15313 feedback: None,
15314 feedback_contract: None,
15315 observes_feedback: false,
15316 },
15317 PropertyDescriptor {
15318 id: PropertyId::TextBoxAcceptsReturn,
15319 name: "AcceptsReturn",
15320 field: "accepts_return",
15321 value: "Bool",
15322 interface: "Microsoft.UI.Xaml.Controls.ITextBox",
15323 clearable: true,
15324 feedback: None,
15325 feedback_contract: None,
15326 observes_feedback: false,
15327 },
15328 PropertyDescriptor {
15329 id: PropertyId::TextBoxTextWrapping,
15330 name: "TextWrapping",
15331 field: "text_wrapping",
15332 value: "TextWrapping",
15333 interface: "Microsoft.UI.Xaml.Controls.ITextBox",
15334 clearable: true,
15335 feedback: None,
15336 feedback_contract: None,
15337 observes_feedback: false,
15338 },
15339 PropertyDescriptor {
15340 id: PropertyId::TextBoxBackground,
15341 name: "Background",
15342 field: "background",
15343 value: "Brush",
15344 interface: "Microsoft.UI.Xaml.Controls.IControl",
15345 clearable: true,
15346 feedback: None,
15347 feedback_contract: None,
15348 observes_feedback: false,
15349 },
15350 PropertyDescriptor {
15351 id: PropertyId::TextBoxBorderBrush,
15352 name: "BorderBrush",
15353 field: "border_brush",
15354 value: "Brush",
15355 interface: "Microsoft.UI.Xaml.Controls.IControl",
15356 clearable: true,
15357 feedback: None,
15358 feedback_contract: None,
15359 observes_feedback: false,
15360 },
15361 PropertyDescriptor {
15362 id: PropertyId::TextBoxBorderThickness,
15363 name: "BorderThickness",
15364 field: "border_thickness",
15365 value: "Thickness",
15366 interface: "Microsoft.UI.Xaml.Controls.IControl",
15367 clearable: true,
15368 feedback: None,
15369 feedback_contract: None,
15370 observes_feedback: false,
15371 },
15372];
15373const TEXT_BOX_EVENTS: &[EventDescriptor] = &[EventDescriptor {
15374 id: EventId::TextBoxTextChanged,
15375 name: "TextChanged",
15376 field: "on_text_changed",
15377 payload: "Str",
15378 interface: "Microsoft.UI.Xaml.Controls.ITextBox",
15379}];
15380const TEXT_BOX_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
15381 id: SlotId::TextBoxHeader,
15382 name: "Header",
15383 interface: "Microsoft.UI.Xaml.Controls.ITextBox",
15384 target: "inspectable",
15385 collection: false,
15386}];
15387const AUTO_SUGGEST_BOX_PROPERTIES: &[PropertyDescriptor] = &[
15388 PropertyDescriptor {
15389 id: PropertyId::AutoSuggestBoxText,
15390 name: "Text",
15391 field: "text",
15392 value: "Str",
15393 interface: "Microsoft.UI.Xaml.Controls.IAutoSuggestBox",
15394 clearable: true,
15395 feedback: Some("TextChanged"),
15396 feedback_contract: Some("synchronous_exact"),
15397 observes_feedback: true,
15398 },
15399 PropertyDescriptor {
15400 id: PropertyId::AutoSuggestBoxItemsSource,
15401 name: "ItemsSource",
15402 field: "items_source",
15403 value: "StrList",
15404 interface: "Microsoft.UI.Xaml.Controls.IItemsControl",
15405 clearable: true,
15406 feedback: None,
15407 feedback_contract: None,
15408 observes_feedback: false,
15409 },
15410 PropertyDescriptor {
15411 id: PropertyId::AutoSuggestBoxPlaceholderText,
15412 name: "PlaceholderText",
15413 field: "placeholder_text",
15414 value: "Str",
15415 interface: "Microsoft.UI.Xaml.Controls.IAutoSuggestBox",
15416 clearable: true,
15417 feedback: None,
15418 feedback_contract: None,
15419 observes_feedback: false,
15420 },
15421 PropertyDescriptor {
15422 id: PropertyId::AutoSuggestBoxIsEnabled,
15423 name: "IsEnabled",
15424 field: "is_enabled",
15425 value: "Bool",
15426 interface: "Microsoft.UI.Xaml.Controls.IControl",
15427 clearable: true,
15428 feedback: None,
15429 feedback_contract: None,
15430 observes_feedback: false,
15431 },
15432];
15433const AUTO_SUGGEST_BOX_EVENTS: &[EventDescriptor] = &[
15434 EventDescriptor {
15435 id: EventId::AutoSuggestBoxTextChanged,
15436 name: "TextChanged",
15437 field: "on_text_changed",
15438 payload: "Str",
15439 interface: "Microsoft.UI.Xaml.Controls.IAutoSuggestBox",
15440 },
15441 EventDescriptor {
15442 id: EventId::AutoSuggestBoxSuggestionChosen,
15443 name: "SuggestionChosen",
15444 field: "on_suggestion_chosen",
15445 payload: "Str",
15446 interface: "Microsoft.UI.Xaml.Controls.IAutoSuggestBox",
15447 },
15448];
15449const AUTO_SUGGEST_BOX_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
15450 id: SlotId::AutoSuggestBoxHeader,
15451 name: "Header",
15452 interface: "Microsoft.UI.Xaml.Controls.IAutoSuggestBox",
15453 target: "inspectable",
15454 collection: false,
15455}];
15456const PASSWORD_BOX_PROPERTIES: &[PropertyDescriptor] = &[
15457 PropertyDescriptor {
15458 id: PropertyId::PasswordBoxPassword,
15459 name: "Password",
15460 field: "password",
15461 value: "Str",
15462 interface: "Microsoft.UI.Xaml.Controls.IPasswordBox",
15463 clearable: true,
15464 feedback: Some("PasswordChanged"),
15465 feedback_contract: Some("synchronous_exact"),
15466 observes_feedback: true,
15467 },
15468 PropertyDescriptor {
15469 id: PropertyId::PasswordBoxPlaceholderText,
15470 name: "PlaceholderText",
15471 field: "placeholder_text",
15472 value: "Str",
15473 interface: "Microsoft.UI.Xaml.Controls.IPasswordBox",
15474 clearable: true,
15475 feedback: None,
15476 feedback_contract: None,
15477 observes_feedback: false,
15478 },
15479 PropertyDescriptor {
15480 id: PropertyId::PasswordBoxPasswordRevealMode,
15481 name: "PasswordRevealMode",
15482 field: "password_reveal_mode",
15483 value: "PasswordRevealMode",
15484 interface: "Microsoft.UI.Xaml.Controls.IPasswordBox",
15485 clearable: true,
15486 feedback: None,
15487 feedback_contract: None,
15488 observes_feedback: false,
15489 },
15490 PropertyDescriptor {
15491 id: PropertyId::PasswordBoxIsEnabled,
15492 name: "IsEnabled",
15493 field: "is_enabled",
15494 value: "Bool",
15495 interface: "Microsoft.UI.Xaml.Controls.IControl",
15496 clearable: true,
15497 feedback: None,
15498 feedback_contract: None,
15499 observes_feedback: false,
15500 },
15501];
15502const PASSWORD_BOX_EVENTS: &[EventDescriptor] = &[EventDescriptor {
15503 id: EventId::PasswordBoxPasswordChanged,
15504 name: "PasswordChanged",
15505 field: "on_password_changed",
15506 payload: "Str",
15507 interface: "Microsoft.UI.Xaml.Controls.IPasswordBox",
15508}];
15509const PASSWORD_BOX_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
15510 id: SlotId::PasswordBoxHeader,
15511 name: "Header",
15512 interface: "Microsoft.UI.Xaml.Controls.IPasswordBox",
15513 target: "inspectable",
15514 collection: false,
15515}];
15516const NUMBER_BOX_PROPERTIES: &[PropertyDescriptor] = &[
15517 PropertyDescriptor {
15518 id: PropertyId::NumberBoxMinimum,
15519 name: "Minimum",
15520 field: "minimum",
15521 value: "F64",
15522 interface: "Microsoft.UI.Xaml.Controls.INumberBox",
15523 clearable: true,
15524 feedback: Some("ValueChanged"),
15525 feedback_contract: Some("synchronous_normalized"),
15526 observes_feedback: false,
15527 },
15528 PropertyDescriptor {
15529 id: PropertyId::NumberBoxMaximum,
15530 name: "Maximum",
15531 field: "maximum",
15532 value: "F64",
15533 interface: "Microsoft.UI.Xaml.Controls.INumberBox",
15534 clearable: true,
15535 feedback: Some("ValueChanged"),
15536 feedback_contract: Some("synchronous_normalized"),
15537 observes_feedback: false,
15538 },
15539 PropertyDescriptor {
15540 id: PropertyId::NumberBoxValue,
15541 name: "Value",
15542 field: "value",
15543 value: "OptionalF64",
15544 interface: "Microsoft.UI.Xaml.Controls.INumberBox",
15545 clearable: true,
15546 feedback: Some("ValueChanged"),
15547 feedback_contract: Some("synchronous_normalized"),
15548 observes_feedback: true,
15549 },
15550 PropertyDescriptor {
15551 id: PropertyId::NumberBoxIsEnabled,
15552 name: "IsEnabled",
15553 field: "is_enabled",
15554 value: "Bool",
15555 interface: "Microsoft.UI.Xaml.Controls.IControl",
15556 clearable: true,
15557 feedback: None,
15558 feedback_contract: None,
15559 observes_feedback: false,
15560 },
15561];
15562const NUMBER_BOX_EVENTS: &[EventDescriptor] = &[EventDescriptor {
15563 id: EventId::NumberBoxValueChanged,
15564 name: "ValueChanged",
15565 field: "on_value_changed",
15566 payload: "OptionalF64",
15567 interface: "Microsoft.UI.Xaml.Controls.INumberBox",
15568}];
15569const NUMBER_BOX_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
15570 id: SlotId::NumberBoxHeader,
15571 name: "Header",
15572 interface: "Microsoft.UI.Xaml.Controls.INumberBox",
15573 target: "inspectable",
15574 collection: false,
15575}];
15576const SLIDER_PROPERTIES: &[PropertyDescriptor] = &[
15577 PropertyDescriptor {
15578 id: PropertyId::SliderMinimum,
15579 name: "Minimum",
15580 field: "minimum",
15581 value: "F64",
15582 interface: "Microsoft.UI.Xaml.Controls.Primitives.IRangeBase",
15583 clearable: true,
15584 feedback: Some("ValueChanged"),
15585 feedback_contract: Some("synchronous_normalized"),
15586 observes_feedback: false,
15587 },
15588 PropertyDescriptor {
15589 id: PropertyId::SliderMaximum,
15590 name: "Maximum",
15591 field: "maximum",
15592 value: "F64",
15593 interface: "Microsoft.UI.Xaml.Controls.Primitives.IRangeBase",
15594 clearable: true,
15595 feedback: Some("ValueChanged"),
15596 feedback_contract: Some("synchronous_normalized"),
15597 observes_feedback: false,
15598 },
15599 PropertyDescriptor {
15600 id: PropertyId::SliderValue,
15601 name: "Value",
15602 field: "value",
15603 value: "F64",
15604 interface: "Microsoft.UI.Xaml.Controls.Primitives.IRangeBase",
15605 clearable: true,
15606 feedback: Some("ValueChanged"),
15607 feedback_contract: Some("synchronous_normalized"),
15608 observes_feedback: true,
15609 },
15610 PropertyDescriptor {
15611 id: PropertyId::SliderIsEnabled,
15612 name: "IsEnabled",
15613 field: "is_enabled",
15614 value: "Bool",
15615 interface: "Microsoft.UI.Xaml.Controls.IControl",
15616 clearable: true,
15617 feedback: None,
15618 feedback_contract: None,
15619 observes_feedback: false,
15620 },
15621 PropertyDescriptor {
15622 id: PropertyId::SliderStepFrequency,
15623 name: "StepFrequency",
15624 field: "step_frequency",
15625 value: "F64",
15626 interface: "Microsoft.UI.Xaml.Controls.ISlider",
15627 clearable: true,
15628 feedback: None,
15629 feedback_contract: None,
15630 observes_feedback: false,
15631 },
15632 PropertyDescriptor {
15633 id: PropertyId::SliderOrientation,
15634 name: "Orientation",
15635 field: "orientation",
15636 value: "Orientation",
15637 interface: "Microsoft.UI.Xaml.Controls.ISlider",
15638 clearable: true,
15639 feedback: None,
15640 feedback_contract: None,
15641 observes_feedback: false,
15642 },
15643];
15644const SLIDER_EVENTS: &[EventDescriptor] = &[EventDescriptor {
15645 id: EventId::SliderValueChanged,
15646 name: "ValueChanged",
15647 field: "on_value_changed",
15648 payload: "F64",
15649 interface: "Microsoft.UI.Xaml.Controls.Primitives.IRangeBase",
15650}];
15651const SLIDER_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
15652 id: SlotId::SliderHeader,
15653 name: "Header",
15654 interface: "Microsoft.UI.Xaml.Controls.ISlider",
15655 target: "inspectable",
15656 collection: false,
15657}];
15658const TITLE_BAR_PROPERTIES: &[PropertyDescriptor] = &[
15659 PropertyDescriptor {
15660 id: PropertyId::TitleBarTitle,
15661 name: "Title",
15662 field: "title",
15663 value: "Str",
15664 interface: "Microsoft.UI.Xaml.Controls.ITitleBar",
15665 clearable: true,
15666 feedback: None,
15667 feedback_contract: None,
15668 observes_feedback: false,
15669 },
15670 PropertyDescriptor {
15671 id: PropertyId::TitleBarSubtitle,
15672 name: "Subtitle",
15673 field: "subtitle",
15674 value: "Str",
15675 interface: "Microsoft.UI.Xaml.Controls.ITitleBar",
15676 clearable: true,
15677 feedback: None,
15678 feedback_contract: None,
15679 observes_feedback: false,
15680 },
15681 PropertyDescriptor {
15682 id: PropertyId::TitleBarIsBackButtonVisible,
15683 name: "IsBackButtonVisible",
15684 field: "is_back_button_visible",
15685 value: "Bool",
15686 interface: "Microsoft.UI.Xaml.Controls.ITitleBar",
15687 clearable: true,
15688 feedback: None,
15689 feedback_contract: None,
15690 observes_feedback: false,
15691 },
15692 PropertyDescriptor {
15693 id: PropertyId::TitleBarIsBackButtonEnabled,
15694 name: "IsBackButtonEnabled",
15695 field: "is_back_button_enabled",
15696 value: "Bool",
15697 interface: "Microsoft.UI.Xaml.Controls.ITitleBar",
15698 clearable: true,
15699 feedback: None,
15700 feedback_contract: None,
15701 observes_feedback: false,
15702 },
15703 PropertyDescriptor {
15704 id: PropertyId::TitleBarIsPaneToggleButtonVisible,
15705 name: "IsPaneToggleButtonVisible",
15706 field: "is_pane_toggle_button_visible",
15707 value: "Bool",
15708 interface: "Microsoft.UI.Xaml.Controls.ITitleBar",
15709 clearable: true,
15710 feedback: None,
15711 feedback_contract: None,
15712 observes_feedback: false,
15713 },
15714];
15715const TITLE_BAR_EVENTS: &[EventDescriptor] = &[
15716 EventDescriptor {
15717 id: EventId::TitleBarBackRequested,
15718 name: "BackRequested",
15719 field: "on_back_requested",
15720 payload: "Unit",
15721 interface: "Microsoft.UI.Xaml.Controls.ITitleBar",
15722 },
15723 EventDescriptor {
15724 id: EventId::TitleBarPaneToggleRequested,
15725 name: "PaneToggleRequested",
15726 field: "on_pane_toggle_requested",
15727 payload: "Unit",
15728 interface: "Microsoft.UI.Xaml.Controls.ITitleBar",
15729 },
15730];
15731const TITLE_BAR_SLOTS: &[SlotDescriptor] = &[
15732 SlotDescriptor {
15733 id: SlotId::TitleBarContent,
15734 name: "Content",
15735 interface: "Microsoft.UI.Xaml.Controls.ITitleBar",
15736 target: "ui_element",
15737 collection: false,
15738 },
15739 SlotDescriptor {
15740 id: SlotId::TitleBarRightHeader,
15741 name: "RightHeader",
15742 interface: "Microsoft.UI.Xaml.Controls.ITitleBar",
15743 target: "ui_element",
15744 collection: false,
15745 },
15746];
15747const NAVIGATION_VIEW_PROPERTIES: &[PropertyDescriptor] = &[
15748 PropertyDescriptor {
15749 id: PropertyId::NavigationViewIsEnabled,
15750 name: "IsEnabled",
15751 field: "is_enabled",
15752 value: "Bool",
15753 interface: "Microsoft.UI.Xaml.Controls.IControl",
15754 clearable: true,
15755 feedback: None,
15756 feedback_contract: None,
15757 observes_feedback: false,
15758 },
15759 PropertyDescriptor {
15760 id: PropertyId::NavigationViewPaneDisplayMode,
15761 name: "PaneDisplayMode",
15762 field: "pane_display_mode",
15763 value: "NavigationViewPaneDisplayMode",
15764 interface: "Microsoft.UI.Xaml.Controls.INavigationView2",
15765 clearable: true,
15766 feedback: None,
15767 feedback_contract: None,
15768 observes_feedback: false,
15769 },
15770 PropertyDescriptor {
15771 id: PropertyId::NavigationViewIsPaneToggleButtonVisible,
15772 name: "IsPaneToggleButtonVisible",
15773 field: "is_pane_toggle_button_visible",
15774 value: "Bool",
15775 interface: "Microsoft.UI.Xaml.Controls.INavigationView",
15776 clearable: true,
15777 feedback: None,
15778 feedback_contract: None,
15779 observes_feedback: false,
15780 },
15781 PropertyDescriptor {
15782 id: PropertyId::NavigationViewIsBackButtonVisible,
15783 name: "IsBackButtonVisible",
15784 field: "is_back_button_visible",
15785 value: "NavigationViewBackButtonVisible",
15786 interface: "Microsoft.UI.Xaml.Controls.INavigationView2",
15787 clearable: true,
15788 feedback: None,
15789 feedback_contract: None,
15790 observes_feedback: false,
15791 },
15792 PropertyDescriptor {
15793 id: PropertyId::NavigationViewIsSettingsVisible,
15794 name: "IsSettingsVisible",
15795 field: "is_settings_visible",
15796 value: "Bool",
15797 interface: "Microsoft.UI.Xaml.Controls.INavigationView",
15798 clearable: true,
15799 feedback: None,
15800 feedback_contract: None,
15801 observes_feedback: false,
15802 },
15803 PropertyDescriptor {
15804 id: PropertyId::NavigationViewAlwaysShowHeader,
15805 name: "AlwaysShowHeader",
15806 field: "always_show_header",
15807 value: "Bool",
15808 interface: "Microsoft.UI.Xaml.Controls.INavigationView",
15809 clearable: true,
15810 feedback: None,
15811 feedback_contract: None,
15812 observes_feedback: false,
15813 },
15814 PropertyDescriptor {
15815 id: PropertyId::NavigationViewPaneTitle,
15816 name: "PaneTitle",
15817 field: "pane_title",
15818 value: "Str",
15819 interface: "Microsoft.UI.Xaml.Controls.INavigationView2",
15820 clearable: true,
15821 feedback: None,
15822 feedback_contract: None,
15823 observes_feedback: false,
15824 },
15825 PropertyDescriptor {
15826 id: PropertyId::NavigationViewOpenPaneLength,
15827 name: "OpenPaneLength",
15828 field: "open_pane_length",
15829 value: "F64",
15830 interface: "Microsoft.UI.Xaml.Controls.INavigationView",
15831 clearable: true,
15832 feedback: None,
15833 feedback_contract: None,
15834 observes_feedback: false,
15835 },
15836 PropertyDescriptor {
15837 id: PropertyId::NavigationViewIsPaneOpen,
15838 name: "IsPaneOpen",
15839 field: "is_pane_open",
15840 value: "Bool",
15841 interface: "Microsoft.UI.Xaml.Controls.INavigationView",
15842 clearable: true,
15843 feedback: Some("IsPaneOpenChanged"),
15844 feedback_contract: Some("synchronous_exact"),
15845 observes_feedback: true,
15846 },
15847];
15848const NAVIGATION_VIEW_EVENTS: &[EventDescriptor] = &[
15849 EventDescriptor {
15850 id: EventId::NavigationViewIsPaneOpenChanged,
15851 name: "IsPaneOpenChanged",
15852 field: "on_is_pane_open_changed",
15853 payload: "Bool",
15854 interface: "Microsoft.UI.Xaml.Controls.INavigationView",
15855 },
15856 EventDescriptor {
15857 id: EventId::NavigationViewDisplayModeChanged,
15858 name: "DisplayModeChanged",
15859 field: "on_display_mode_changed",
15860 payload: "NavigationViewDisplayMode",
15861 interface: "Microsoft.UI.Xaml.Controls.INavigationView",
15862 },
15863 EventDescriptor {
15864 id: EventId::NavigationViewSelectionChanged,
15865 name: "SelectionChanged",
15866 field: "on_selected_tag_changed",
15867 payload: "SelectionChange",
15868 interface: "Microsoft.UI.Xaml.Controls.INavigationView",
15869 },
15870];
15871const NAVIGATION_VIEW_SLOTS: &[SlotDescriptor] = &[
15872 SlotDescriptor {
15873 id: SlotId::NavigationViewContent,
15874 name: "Content",
15875 interface: "Microsoft.UI.Xaml.Controls.IContentControl",
15876 target: "inspectable",
15877 collection: false,
15878 },
15879 SlotDescriptor {
15880 id: SlotId::NavigationViewHeader,
15881 name: "Header",
15882 interface: "Microsoft.UI.Xaml.Controls.INavigationView",
15883 target: "inspectable",
15884 collection: false,
15885 },
15886 SlotDescriptor {
15887 id: SlotId::NavigationViewPaneCustomContent,
15888 name: "PaneCustomContent",
15889 interface: "Microsoft.UI.Xaml.Controls.INavigationView2",
15890 target: "ui_element",
15891 collection: false,
15892 },
15893 SlotDescriptor {
15894 id: SlotId::NavigationViewPaneFooter,
15895 name: "PaneFooter",
15896 interface: "Microsoft.UI.Xaml.Controls.INavigationView",
15897 target: "ui_element",
15898 collection: false,
15899 },
15900 SlotDescriptor {
15901 id: SlotId::NavigationViewMenuItems,
15902 name: "MenuItems",
15903 interface: "Microsoft.UI.Xaml.Controls.INavigationView",
15904 target: "inspectable",
15905 collection: true,
15906 },
15907];
15908const NAVIGATION_VIEW_ITEM_PROPERTIES: &[PropertyDescriptor] = &[
15909 PropertyDescriptor {
15910 id: PropertyId::NavigationViewItemTag,
15911 name: "Tag",
15912 field: "tag",
15913 value: "Str",
15914 interface: "Microsoft.UI.Xaml.IFrameworkElement",
15915 clearable: true,
15916 feedback: None,
15917 feedback_contract: None,
15918 observes_feedback: false,
15919 },
15920 PropertyDescriptor {
15921 id: PropertyId::NavigationViewItemIsSelected,
15922 name: "IsSelected",
15923 field: "is_selected",
15924 value: "Bool",
15925 interface: "Microsoft.UI.Xaml.Controls.INavigationViewItemBase2",
15926 clearable: true,
15927 feedback: None,
15928 feedback_contract: None,
15929 observes_feedback: false,
15930 },
15931 PropertyDescriptor {
15932 id: PropertyId::NavigationViewItemSelectsOnInvoked,
15933 name: "SelectsOnInvoked",
15934 field: "selects_on_invoked",
15935 value: "Bool",
15936 interface: "Microsoft.UI.Xaml.Controls.INavigationViewItem2",
15937 clearable: true,
15938 feedback: None,
15939 feedback_contract: None,
15940 observes_feedback: false,
15941 },
15942 PropertyDescriptor {
15943 id: PropertyId::NavigationViewItemIsExpanded,
15944 name: "IsExpanded",
15945 field: "is_expanded",
15946 value: "Bool",
15947 interface: "Microsoft.UI.Xaml.Controls.INavigationViewItem2",
15948 clearable: true,
15949 feedback: None,
15950 feedback_contract: None,
15951 observes_feedback: false,
15952 },
15953];
15954const NAVIGATION_VIEW_ITEM_EVENTS: &[EventDescriptor] = &[];
15955const NAVIGATION_VIEW_ITEM_SLOTS: &[SlotDescriptor] = &[
15956 SlotDescriptor {
15957 id: SlotId::NavigationViewItemContent,
15958 name: "Content",
15959 interface: "Microsoft.UI.Xaml.Controls.IContentControl",
15960 target: "inspectable",
15961 collection: false,
15962 },
15963 SlotDescriptor {
15964 id: SlotId::NavigationViewItemIcon,
15965 name: "Icon",
15966 interface: "Microsoft.UI.Xaml.Controls.INavigationViewItem",
15967 target: "icon_element",
15968 collection: false,
15969 },
15970 SlotDescriptor {
15971 id: SlotId::NavigationViewItemMenuItems,
15972 name: "MenuItems",
15973 interface: "Microsoft.UI.Xaml.Controls.INavigationViewItem2",
15974 target: "inspectable",
15975 collection: true,
15976 },
15977];
15978const SPLIT_VIEW_PROPERTIES: &[PropertyDescriptor] = &[
15979 PropertyDescriptor {
15980 id: PropertyId::SplitViewOpenPaneLength,
15981 name: "OpenPaneLength",
15982 field: "open_pane_length",
15983 value: "F64",
15984 interface: "Microsoft.UI.Xaml.Controls.ISplitView",
15985 clearable: true,
15986 feedback: None,
15987 feedback_contract: None,
15988 observes_feedback: false,
15989 },
15990 PropertyDescriptor {
15991 id: PropertyId::SplitViewCompactPaneLength,
15992 name: "CompactPaneLength",
15993 field: "compact_pane_length",
15994 value: "F64",
15995 interface: "Microsoft.UI.Xaml.Controls.ISplitView",
15996 clearable: true,
15997 feedback: None,
15998 feedback_contract: None,
15999 observes_feedback: false,
16000 },
16001 PropertyDescriptor {
16002 id: PropertyId::SplitViewDisplayMode,
16003 name: "DisplayMode",
16004 field: "display_mode",
16005 value: "SplitViewDisplayMode",
16006 interface: "Microsoft.UI.Xaml.Controls.ISplitView",
16007 clearable: true,
16008 feedback: None,
16009 feedback_contract: None,
16010 observes_feedback: false,
16011 },
16012 PropertyDescriptor {
16013 id: PropertyId::SplitViewIsPaneOpen,
16014 name: "IsPaneOpen",
16015 field: "is_pane_open",
16016 value: "Bool",
16017 interface: "Microsoft.UI.Xaml.Controls.ISplitView",
16018 clearable: true,
16019 feedback: Some("PaneClosed"),
16020 feedback_contract: Some("synchronous_exact"),
16021 observes_feedback: true,
16022 },
16023];
16024const SPLIT_VIEW_EVENTS: &[EventDescriptor] = &[EventDescriptor {
16025 id: EventId::SplitViewPaneClosed,
16026 name: "PaneClosed",
16027 field: "on_pane_closed",
16028 payload: "Bool",
16029 interface: "Microsoft.UI.Xaml.Controls.ISplitView",
16030}];
16031const SPLIT_VIEW_SLOTS: &[SlotDescriptor] = &[
16032 SlotDescriptor {
16033 id: SlotId::SplitViewPane,
16034 name: "Pane",
16035 interface: "Microsoft.UI.Xaml.Controls.ISplitView",
16036 target: "ui_element",
16037 collection: false,
16038 },
16039 SlotDescriptor {
16040 id: SlotId::SplitViewContent,
16041 name: "Content",
16042 interface: "Microsoft.UI.Xaml.Controls.ISplitView",
16043 target: "ui_element",
16044 collection: false,
16045 },
16046];
16047const PROGRESS_BAR_PROPERTIES: &[PropertyDescriptor] = &[
16048 PropertyDescriptor {
16049 id: PropertyId::ProgressBarMinimum,
16050 name: "Minimum",
16051 field: "minimum",
16052 value: "F64",
16053 interface: "Microsoft.UI.Xaml.Controls.Primitives.IRangeBase",
16054 clearable: true,
16055 feedback: None,
16056 feedback_contract: None,
16057 observes_feedback: false,
16058 },
16059 PropertyDescriptor {
16060 id: PropertyId::ProgressBarMaximum,
16061 name: "Maximum",
16062 field: "maximum",
16063 value: "F64",
16064 interface: "Microsoft.UI.Xaml.Controls.Primitives.IRangeBase",
16065 clearable: true,
16066 feedback: None,
16067 feedback_contract: None,
16068 observes_feedback: false,
16069 },
16070 PropertyDescriptor {
16071 id: PropertyId::ProgressBarValue,
16072 name: "Value",
16073 field: "value",
16074 value: "F64",
16075 interface: "Microsoft.UI.Xaml.Controls.Primitives.IRangeBase",
16076 clearable: true,
16077 feedback: None,
16078 feedback_contract: None,
16079 observes_feedback: false,
16080 },
16081 PropertyDescriptor {
16082 id: PropertyId::ProgressBarIsIndeterminate,
16083 name: "IsIndeterminate",
16084 field: "is_indeterminate",
16085 value: "Bool",
16086 interface: "Microsoft.UI.Xaml.Controls.IProgressBar",
16087 clearable: true,
16088 feedback: None,
16089 feedback_contract: None,
16090 observes_feedback: false,
16091 },
16092 PropertyDescriptor {
16093 id: PropertyId::ProgressBarShowError,
16094 name: "ShowError",
16095 field: "show_error",
16096 value: "Bool",
16097 interface: "Microsoft.UI.Xaml.Controls.IProgressBar",
16098 clearable: true,
16099 feedback: None,
16100 feedback_contract: None,
16101 observes_feedback: false,
16102 },
16103 PropertyDescriptor {
16104 id: PropertyId::ProgressBarShowPaused,
16105 name: "ShowPaused",
16106 field: "show_paused",
16107 value: "Bool",
16108 interface: "Microsoft.UI.Xaml.Controls.IProgressBar",
16109 clearable: true,
16110 feedback: None,
16111 feedback_contract: None,
16112 observes_feedback: false,
16113 },
16114 PropertyDescriptor {
16115 id: PropertyId::ProgressBarIsEnabled,
16116 name: "IsEnabled",
16117 field: "is_enabled",
16118 value: "Bool",
16119 interface: "Microsoft.UI.Xaml.Controls.IControl",
16120 clearable: true,
16121 feedback: None,
16122 feedback_contract: None,
16123 observes_feedback: false,
16124 },
16125];
16126const PROGRESS_BAR_EVENTS: &[EventDescriptor] = &[];
16127const PROGRESS_BAR_SLOTS: &[SlotDescriptor] = &[];
16128const TOGGLE_SWITCH_PROPERTIES: &[PropertyDescriptor] = &[
16129 PropertyDescriptor {
16130 id: PropertyId::ToggleSwitchIsOn,
16131 name: "IsOn",
16132 field: "is_on",
16133 value: "Bool",
16134 interface: "Microsoft.UI.Xaml.Controls.IToggleSwitch",
16135 clearable: true,
16136 feedback: Some("Toggled"),
16137 feedback_contract: Some("synchronous_exact"),
16138 observes_feedback: true,
16139 },
16140 PropertyDescriptor {
16141 id: PropertyId::ToggleSwitchIsEnabled,
16142 name: "IsEnabled",
16143 field: "is_enabled",
16144 value: "Bool",
16145 interface: "Microsoft.UI.Xaml.Controls.IControl",
16146 clearable: true,
16147 feedback: None,
16148 feedback_contract: None,
16149 observes_feedback: false,
16150 },
16151];
16152const TOGGLE_SWITCH_EVENTS: &[EventDescriptor] = &[EventDescriptor {
16153 id: EventId::ToggleSwitchToggled,
16154 name: "Toggled",
16155 field: "on_toggled",
16156 payload: "Bool",
16157 interface: "Microsoft.UI.Xaml.Controls.IToggleSwitch",
16158}];
16159const TOGGLE_SWITCH_SLOTS: &[SlotDescriptor] = &[
16160 SlotDescriptor {
16161 id: SlotId::ToggleSwitchHeader,
16162 name: "Header",
16163 interface: "Microsoft.UI.Xaml.Controls.IToggleSwitch",
16164 target: "inspectable",
16165 collection: false,
16166 },
16167 SlotDescriptor {
16168 id: SlotId::ToggleSwitchOnContent,
16169 name: "OnContent",
16170 interface: "Microsoft.UI.Xaml.Controls.IToggleSwitch",
16171 target: "inspectable",
16172 collection: false,
16173 },
16174 SlotDescriptor {
16175 id: SlotId::ToggleSwitchOffContent,
16176 name: "OffContent",
16177 interface: "Microsoft.UI.Xaml.Controls.IToggleSwitch",
16178 target: "inspectable",
16179 collection: false,
16180 },
16181];
16182const CHECK_BOX_PROPERTIES: &[PropertyDescriptor] = &[
16183 PropertyDescriptor {
16184 id: PropertyId::CheckBoxIsChecked,
16185 name: "IsChecked",
16186 field: "is_checked",
16187 value: "Bool",
16188 interface: "Microsoft.UI.Xaml.Controls.Primitives.IToggleButton",
16189 clearable: true,
16190 feedback: Some("IsCheckedChanged"),
16191 feedback_contract: Some("synchronous_exact"),
16192 observes_feedback: true,
16193 },
16194 PropertyDescriptor {
16195 id: PropertyId::CheckBoxIsEnabled,
16196 name: "IsEnabled",
16197 field: "is_enabled",
16198 value: "Bool",
16199 interface: "Microsoft.UI.Xaml.Controls.IControl",
16200 clearable: true,
16201 feedback: None,
16202 feedback_contract: None,
16203 observes_feedback: false,
16204 },
16205];
16206const CHECK_BOX_EVENTS: &[EventDescriptor] = &[EventDescriptor {
16207 id: EventId::CheckBoxIsCheckedChanged,
16208 name: "IsCheckedChanged",
16209 field: "on_is_checked_changed",
16210 payload: "Bool",
16211 interface: "Microsoft.UI.Xaml.Controls.Primitives.IToggleButton",
16212}];
16213const CHECK_BOX_SLOTS: &[SlotDescriptor] = &[];
16214const TOGGLE_BUTTON_PROPERTIES: &[PropertyDescriptor] = &[
16215 PropertyDescriptor {
16216 id: PropertyId::ToggleButtonIsChecked,
16217 name: "IsChecked",
16218 field: "is_checked",
16219 value: "Bool",
16220 interface: "Microsoft.UI.Xaml.Controls.Primitives.IToggleButton",
16221 clearable: true,
16222 feedback: Some("IsCheckedChanged"),
16223 feedback_contract: Some("synchronous_exact"),
16224 observes_feedback: true,
16225 },
16226 PropertyDescriptor {
16227 id: PropertyId::ToggleButtonIsEnabled,
16228 name: "IsEnabled",
16229 field: "is_enabled",
16230 value: "Bool",
16231 interface: "Microsoft.UI.Xaml.Controls.IControl",
16232 clearable: true,
16233 feedback: None,
16234 feedback_contract: None,
16235 observes_feedback: false,
16236 },
16237];
16238const TOGGLE_BUTTON_EVENTS: &[EventDescriptor] = &[EventDescriptor {
16239 id: EventId::ToggleButtonIsCheckedChanged,
16240 name: "IsCheckedChanged",
16241 field: "on_is_checked_changed",
16242 payload: "Bool",
16243 interface: "Microsoft.UI.Xaml.Controls.Primitives.IToggleButton",
16244}];
16245const TOGGLE_BUTTON_SLOTS: &[SlotDescriptor] = &[];
16246const RADIO_BUTTON_PROPERTIES: &[PropertyDescriptor] = &[
16247 PropertyDescriptor {
16248 id: PropertyId::RadioButtonGroupName,
16249 name: "GroupName",
16250 field: "group_name",
16251 value: "Str",
16252 interface: "Microsoft.UI.Xaml.Controls.IRadioButton",
16253 clearable: true,
16254 feedback: None,
16255 feedback_contract: None,
16256 observes_feedback: false,
16257 },
16258 PropertyDescriptor {
16259 id: PropertyId::RadioButtonIsChecked,
16260 name: "IsChecked",
16261 field: "is_checked",
16262 value: "Bool",
16263 interface: "Microsoft.UI.Xaml.Controls.Primitives.IToggleButton",
16264 clearable: true,
16265 feedback: Some("Checked"),
16266 feedback_contract: Some("synchronous_exact"),
16267 observes_feedback: true,
16268 },
16269 PropertyDescriptor {
16270 id: PropertyId::RadioButtonIsEnabled,
16271 name: "IsEnabled",
16272 field: "is_enabled",
16273 value: "Bool",
16274 interface: "Microsoft.UI.Xaml.Controls.IControl",
16275 clearable: true,
16276 feedback: None,
16277 feedback_contract: None,
16278 observes_feedback: false,
16279 },
16280];
16281const RADIO_BUTTON_EVENTS: &[EventDescriptor] = &[EventDescriptor {
16282 id: EventId::RadioButtonChecked,
16283 name: "Checked",
16284 field: "on_checked",
16285 payload: "Bool",
16286 interface: "Microsoft.UI.Xaml.Controls.Primitives.IToggleButton",
16287}];
16288const RADIO_BUTTON_SLOTS: &[SlotDescriptor] = &[];
16289const RADIO_BUTTONS_PROPERTIES: &[PropertyDescriptor] = &[
16290 PropertyDescriptor {
16291 id: PropertyId::RadioButtonsItemsSource,
16292 name: "ItemsSource",
16293 field: "items_source",
16294 value: "StrList",
16295 interface: "Microsoft.UI.Xaml.Controls.IRadioButtons",
16296 clearable: true,
16297 feedback: None,
16298 feedback_contract: None,
16299 observes_feedback: false,
16300 },
16301 PropertyDescriptor {
16302 id: PropertyId::RadioButtonsSelectedIndex,
16303 name: "SelectedIndex",
16304 field: "selected_index",
16305 value: "SelectionIndex",
16306 interface: "Microsoft.UI.Xaml.Controls.IRadioButtons",
16307 clearable: true,
16308 feedback: Some("SelectionChanged"),
16309 feedback_contract: Some("synchronous_normalized"),
16310 observes_feedback: true,
16311 },
16312 PropertyDescriptor {
16313 id: PropertyId::RadioButtonsMaxColumns,
16314 name: "MaxColumns",
16315 field: "max_columns",
16316 value: "I32",
16317 interface: "Microsoft.UI.Xaml.Controls.IRadioButtons",
16318 clearable: true,
16319 feedback: None,
16320 feedback_contract: None,
16321 observes_feedback: false,
16322 },
16323];
16324const RADIO_BUTTONS_EVENTS: &[EventDescriptor] = &[EventDescriptor {
16325 id: EventId::RadioButtonsSelectionChanged,
16326 name: "SelectionChanged",
16327 field: "on_selection_changed",
16328 payload: "SelectionIndex",
16329 interface: "Microsoft.UI.Xaml.Controls.IRadioButtons",
16330}];
16331const RADIO_BUTTONS_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
16332 id: SlotId::RadioButtonsHeader,
16333 name: "Header",
16334 interface: "Microsoft.UI.Xaml.Controls.IRadioButtons",
16335 target: "inspectable",
16336 collection: false,
16337}];
16338const ITEMS_REPEATER_PROPERTIES: &[PropertyDescriptor] = &[];
16339const ITEMS_REPEATER_EVENTS: &[EventDescriptor] = &[];
16340const ITEMS_REPEATER_SLOTS: &[SlotDescriptor] = &[];
16341const INFO_BADGE_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
16342 id: PropertyId::InfoBadgeValue,
16343 name: "Value",
16344 field: "value",
16345 value: "I32",
16346 interface: "Microsoft.UI.Xaml.Controls.IInfoBadge",
16347 clearable: true,
16348 feedback: None,
16349 feedback_contract: None,
16350 observes_feedback: false,
16351}];
16352const INFO_BADGE_EVENTS: &[EventDescriptor] = &[];
16353const INFO_BADGE_SLOTS: &[SlotDescriptor] = &[];
16354const INFO_BAR_PROPERTIES: &[PropertyDescriptor] = &[
16355 PropertyDescriptor {
16356 id: PropertyId::InfoBarTitle,
16357 name: "Title",
16358 field: "title",
16359 value: "Str",
16360 interface: "Microsoft.UI.Xaml.Controls.IInfoBar",
16361 clearable: true,
16362 feedback: None,
16363 feedback_contract: None,
16364 observes_feedback: false,
16365 },
16366 PropertyDescriptor {
16367 id: PropertyId::InfoBarMessage,
16368 name: "Message",
16369 field: "message",
16370 value: "Str",
16371 interface: "Microsoft.UI.Xaml.Controls.IInfoBar",
16372 clearable: true,
16373 feedback: None,
16374 feedback_contract: None,
16375 observes_feedback: false,
16376 },
16377 PropertyDescriptor {
16378 id: PropertyId::InfoBarSeverity,
16379 name: "Severity",
16380 field: "severity",
16381 value: "InfoBarSeverity",
16382 interface: "Microsoft.UI.Xaml.Controls.IInfoBar",
16383 clearable: true,
16384 feedback: None,
16385 feedback_contract: None,
16386 observes_feedback: false,
16387 },
16388 PropertyDescriptor {
16389 id: PropertyId::InfoBarIsOpen,
16390 name: "IsOpen",
16391 field: "is_open",
16392 value: "Bool",
16393 interface: "Microsoft.UI.Xaml.Controls.IInfoBar",
16394 clearable: true,
16395 feedback: None,
16396 feedback_contract: None,
16397 observes_feedback: false,
16398 },
16399 PropertyDescriptor {
16400 id: PropertyId::InfoBarIsClosable,
16401 name: "IsClosable",
16402 field: "is_closable",
16403 value: "Bool",
16404 interface: "Microsoft.UI.Xaml.Controls.IInfoBar",
16405 clearable: true,
16406 feedback: None,
16407 feedback_contract: None,
16408 observes_feedback: false,
16409 },
16410];
16411const INFO_BAR_EVENTS: &[EventDescriptor] = &[EventDescriptor {
16412 id: EventId::InfoBarClosed,
16413 name: "Closed",
16414 field: "on_closed",
16415 payload: "Unit",
16416 interface: "Microsoft.UI.Xaml.Controls.IInfoBar",
16417}];
16418const INFO_BAR_SLOTS: &[SlotDescriptor] = &[];
16419const PERSON_PICTURE_PROPERTIES: &[PropertyDescriptor] = &[
16420 PropertyDescriptor {
16421 id: PropertyId::PersonPictureDisplayName,
16422 name: "DisplayName",
16423 field: "display_name",
16424 value: "Str",
16425 interface: "Microsoft.UI.Xaml.Controls.IPersonPicture",
16426 clearable: true,
16427 feedback: None,
16428 feedback_contract: None,
16429 observes_feedback: false,
16430 },
16431 PropertyDescriptor {
16432 id: PropertyId::PersonPictureInitials,
16433 name: "Initials",
16434 field: "initials",
16435 value: "Str",
16436 interface: "Microsoft.UI.Xaml.Controls.IPersonPicture",
16437 clearable: true,
16438 feedback: None,
16439 feedback_contract: None,
16440 observes_feedback: false,
16441 },
16442];
16443const PERSON_PICTURE_EVENTS: &[EventDescriptor] = &[];
16444const PERSON_PICTURE_SLOTS: &[SlotDescriptor] = &[];
16445const SCROLL_VIEWER_PROPERTIES: &[PropertyDescriptor] = &[
16446 PropertyDescriptor {
16447 id: PropertyId::ScrollViewerHorizontalScrollBarVisibility,
16448 name: "HorizontalScrollBarVisibility",
16449 field: "horizontal_scroll_bar_visibility",
16450 value: "ScrollBarVisibility",
16451 interface: "Microsoft.UI.Xaml.Controls.IScrollViewer",
16452 clearable: true,
16453 feedback: None,
16454 feedback_contract: None,
16455 observes_feedback: false,
16456 },
16457 PropertyDescriptor {
16458 id: PropertyId::ScrollViewerVerticalScrollBarVisibility,
16459 name: "VerticalScrollBarVisibility",
16460 field: "vertical_scroll_bar_visibility",
16461 value: "ScrollBarVisibility",
16462 interface: "Microsoft.UI.Xaml.Controls.IScrollViewer",
16463 clearable: true,
16464 feedback: None,
16465 feedback_contract: None,
16466 observes_feedback: false,
16467 },
16468];
16469const SCROLL_VIEWER_EVENTS: &[EventDescriptor] = &[];
16470const SCROLL_VIEWER_SLOTS: &[SlotDescriptor] = &[];
16471const SCROLL_VIEW_PROPERTIES: &[PropertyDescriptor] = &[
16472 PropertyDescriptor {
16473 id: PropertyId::ScrollViewHorizontalScrollBarVisibility,
16474 name: "HorizontalScrollBarVisibility",
16475 field: "horizontal_scroll_bar_visibility",
16476 value: "ScrollingScrollBarVisibility",
16477 interface: "Microsoft.UI.Xaml.Controls.IScrollView",
16478 clearable: true,
16479 feedback: None,
16480 feedback_contract: None,
16481 observes_feedback: false,
16482 },
16483 PropertyDescriptor {
16484 id: PropertyId::ScrollViewVerticalScrollBarVisibility,
16485 name: "VerticalScrollBarVisibility",
16486 field: "vertical_scroll_bar_visibility",
16487 value: "ScrollingScrollBarVisibility",
16488 interface: "Microsoft.UI.Xaml.Controls.IScrollView",
16489 clearable: true,
16490 feedback: None,
16491 feedback_contract: None,
16492 observes_feedback: false,
16493 },
16494];
16495const SCROLL_VIEW_EVENTS: &[EventDescriptor] = &[];
16496const SCROLL_VIEW_SLOTS: &[SlotDescriptor] = &[];
16497const IMAGE_PROPERTIES: &[PropertyDescriptor] = &[
16498 PropertyDescriptor {
16499 id: PropertyId::ImageSource,
16500 name: "Source",
16501 field: "source",
16502 value: "ImageValue",
16503 interface: "Microsoft.UI.Xaml.Controls.IImage",
16504 clearable: true,
16505 feedback: None,
16506 feedback_contract: None,
16507 observes_feedback: false,
16508 },
16509 PropertyDescriptor {
16510 id: PropertyId::ImageStretch,
16511 name: "Stretch",
16512 field: "stretch",
16513 value: "Stretch",
16514 interface: "Microsoft.UI.Xaml.Controls.IImage",
16515 clearable: true,
16516 feedback: None,
16517 feedback_contract: None,
16518 observes_feedback: false,
16519 },
16520];
16521const IMAGE_EVENTS: &[EventDescriptor] = &[
16522 EventDescriptor {
16523 id: EventId::ImageImageOpened,
16524 name: "ImageOpened",
16525 field: "on_opened",
16526 payload: "Unit",
16527 interface: "Microsoft.UI.Xaml.Controls.IImage",
16528 },
16529 EventDescriptor {
16530 id: EventId::ImageImageFailed,
16531 name: "ImageFailed",
16532 field: "on_failed",
16533 payload: "Unit",
16534 interface: "Microsoft.UI.Xaml.Controls.IImage",
16535 },
16536];
16537const IMAGE_SLOTS: &[SlotDescriptor] = &[];
16538const PROGRESS_RING_PROPERTIES: &[PropertyDescriptor] = &[
16539 PropertyDescriptor {
16540 id: PropertyId::ProgressRingMinimum,
16541 name: "Minimum",
16542 field: "minimum",
16543 value: "F64",
16544 interface: "Microsoft.UI.Xaml.Controls.IProgressRing",
16545 clearable: true,
16546 feedback: None,
16547 feedback_contract: None,
16548 observes_feedback: false,
16549 },
16550 PropertyDescriptor {
16551 id: PropertyId::ProgressRingMaximum,
16552 name: "Maximum",
16553 field: "maximum",
16554 value: "F64",
16555 interface: "Microsoft.UI.Xaml.Controls.IProgressRing",
16556 clearable: true,
16557 feedback: None,
16558 feedback_contract: None,
16559 observes_feedback: false,
16560 },
16561 PropertyDescriptor {
16562 id: PropertyId::ProgressRingValue,
16563 name: "Value",
16564 field: "value",
16565 value: "F64",
16566 interface: "Microsoft.UI.Xaml.Controls.IProgressRing",
16567 clearable: true,
16568 feedback: None,
16569 feedback_contract: None,
16570 observes_feedback: false,
16571 },
16572 PropertyDescriptor {
16573 id: PropertyId::ProgressRingIsIndeterminate,
16574 name: "IsIndeterminate",
16575 field: "is_indeterminate",
16576 value: "Bool",
16577 interface: "Microsoft.UI.Xaml.Controls.IProgressRing",
16578 clearable: true,
16579 feedback: None,
16580 feedback_contract: None,
16581 observes_feedback: false,
16582 },
16583 PropertyDescriptor {
16584 id: PropertyId::ProgressRingIsActive,
16585 name: "IsActive",
16586 field: "is_active",
16587 value: "Bool",
16588 interface: "Microsoft.UI.Xaml.Controls.IProgressRing",
16589 clearable: true,
16590 feedback: None,
16591 feedback_contract: None,
16592 observes_feedback: false,
16593 },
16594 PropertyDescriptor {
16595 id: PropertyId::ProgressRingIsEnabled,
16596 name: "IsEnabled",
16597 field: "is_enabled",
16598 value: "Bool",
16599 interface: "Microsoft.UI.Xaml.Controls.IControl",
16600 clearable: true,
16601 feedback: None,
16602 feedback_contract: None,
16603 observes_feedback: false,
16604 },
16605];
16606const PROGRESS_RING_EVENTS: &[EventDescriptor] = &[];
16607const PROGRESS_RING_SLOTS: &[SlotDescriptor] = &[];
16608const LIST_BOX_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
16609 id: PropertyId::ListBoxIsEnabled,
16610 name: "IsEnabled",
16611 field: "is_enabled",
16612 value: "Bool",
16613 interface: "Microsoft.UI.Xaml.Controls.IControl",
16614 clearable: true,
16615 feedback: None,
16616 feedback_contract: None,
16617 observes_feedback: false,
16618}];
16619const LIST_BOX_EVENTS: &[EventDescriptor] = &[EventDescriptor {
16620 id: EventId::ListBoxSelectionChanged,
16621 name: "SelectionChanged",
16622 field: "on_selected_tag_changed",
16623 payload: "SelectionChange",
16624 interface: "Microsoft.UI.Xaml.Controls.Primitives.ISelector",
16625}];
16626const LIST_BOX_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
16627 id: SlotId::ListBoxItems,
16628 name: "Items",
16629 interface: "Microsoft.UI.Xaml.Controls.IItemsControl",
16630 target: "inspectable",
16631 collection: true,
16632}];
16633const RECTANGLE_PROPERTIES: &[PropertyDescriptor] = &[
16634 PropertyDescriptor {
16635 id: PropertyId::RectangleFill,
16636 name: "Fill",
16637 field: "fill",
16638 value: "Brush",
16639 interface: "Microsoft.UI.Xaml.Shapes.IShape",
16640 clearable: true,
16641 feedback: None,
16642 feedback_contract: None,
16643 observes_feedback: false,
16644 },
16645 PropertyDescriptor {
16646 id: PropertyId::RectangleStroke,
16647 name: "Stroke",
16648 field: "stroke",
16649 value: "Brush",
16650 interface: "Microsoft.UI.Xaml.Shapes.IShape",
16651 clearable: true,
16652 feedback: None,
16653 feedback_contract: None,
16654 observes_feedback: false,
16655 },
16656 PropertyDescriptor {
16657 id: PropertyId::RectangleStrokeThickness,
16658 name: "StrokeThickness",
16659 field: "stroke_thickness",
16660 value: "F64",
16661 interface: "Microsoft.UI.Xaml.Shapes.IShape",
16662 clearable: true,
16663 feedback: None,
16664 feedback_contract: None,
16665 observes_feedback: false,
16666 },
16667 PropertyDescriptor {
16668 id: PropertyId::RectangleRadiusX,
16669 name: "RadiusX",
16670 field: "radius_x",
16671 value: "F64",
16672 interface: "Microsoft.UI.Xaml.Shapes.IRectangle",
16673 clearable: true,
16674 feedback: None,
16675 feedback_contract: None,
16676 observes_feedback: false,
16677 },
16678 PropertyDescriptor {
16679 id: PropertyId::RectangleRadiusY,
16680 name: "RadiusY",
16681 field: "radius_y",
16682 value: "F64",
16683 interface: "Microsoft.UI.Xaml.Shapes.IRectangle",
16684 clearable: true,
16685 feedback: None,
16686 feedback_contract: None,
16687 observes_feedback: false,
16688 },
16689];
16690const RECTANGLE_EVENTS: &[EventDescriptor] = &[];
16691const RECTANGLE_SLOTS: &[SlotDescriptor] = &[];
16692const ELLIPSE_PROPERTIES: &[PropertyDescriptor] = &[
16693 PropertyDescriptor {
16694 id: PropertyId::EllipseFill,
16695 name: "Fill",
16696 field: "fill",
16697 value: "Brush",
16698 interface: "Microsoft.UI.Xaml.Shapes.IShape",
16699 clearable: true,
16700 feedback: None,
16701 feedback_contract: None,
16702 observes_feedback: false,
16703 },
16704 PropertyDescriptor {
16705 id: PropertyId::EllipseStroke,
16706 name: "Stroke",
16707 field: "stroke",
16708 value: "Brush",
16709 interface: "Microsoft.UI.Xaml.Shapes.IShape",
16710 clearable: true,
16711 feedback: None,
16712 feedback_contract: None,
16713 observes_feedback: false,
16714 },
16715 PropertyDescriptor {
16716 id: PropertyId::EllipseStrokeThickness,
16717 name: "StrokeThickness",
16718 field: "stroke_thickness",
16719 value: "F64",
16720 interface: "Microsoft.UI.Xaml.Shapes.IShape",
16721 clearable: true,
16722 feedback: None,
16723 feedback_contract: None,
16724 observes_feedback: false,
16725 },
16726];
16727const ELLIPSE_EVENTS: &[EventDescriptor] = &[];
16728const ELLIPSE_SLOTS: &[SlotDescriptor] = &[];
16729const LINE_PROPERTIES: &[PropertyDescriptor] = &[
16730 PropertyDescriptor {
16731 id: PropertyId::LineStroke,
16732 name: "Stroke",
16733 field: "stroke",
16734 value: "Brush",
16735 interface: "Microsoft.UI.Xaml.Shapes.IShape",
16736 clearable: true,
16737 feedback: None,
16738 feedback_contract: None,
16739 observes_feedback: false,
16740 },
16741 PropertyDescriptor {
16742 id: PropertyId::LineStrokeThickness,
16743 name: "StrokeThickness",
16744 field: "stroke_thickness",
16745 value: "F64",
16746 interface: "Microsoft.UI.Xaml.Shapes.IShape",
16747 clearable: true,
16748 feedback: None,
16749 feedback_contract: None,
16750 observes_feedback: false,
16751 },
16752 PropertyDescriptor {
16753 id: PropertyId::LineX1,
16754 name: "X1",
16755 field: "x1",
16756 value: "F64",
16757 interface: "Microsoft.UI.Xaml.Shapes.ILine",
16758 clearable: true,
16759 feedback: None,
16760 feedback_contract: None,
16761 observes_feedback: false,
16762 },
16763 PropertyDescriptor {
16764 id: PropertyId::LineY1,
16765 name: "Y1",
16766 field: "y1",
16767 value: "F64",
16768 interface: "Microsoft.UI.Xaml.Shapes.ILine",
16769 clearable: true,
16770 feedback: None,
16771 feedback_contract: None,
16772 observes_feedback: false,
16773 },
16774 PropertyDescriptor {
16775 id: PropertyId::LineX2,
16776 name: "X2",
16777 field: "x2",
16778 value: "F64",
16779 interface: "Microsoft.UI.Xaml.Shapes.ILine",
16780 clearable: true,
16781 feedback: None,
16782 feedback_contract: None,
16783 observes_feedback: false,
16784 },
16785 PropertyDescriptor {
16786 id: PropertyId::LineY2,
16787 name: "Y2",
16788 field: "y2",
16789 value: "F64",
16790 interface: "Microsoft.UI.Xaml.Shapes.ILine",
16791 clearable: true,
16792 feedback: None,
16793 feedback_contract: None,
16794 observes_feedback: false,
16795 },
16796];
16797const LINE_EVENTS: &[EventDescriptor] = &[];
16798const LINE_SLOTS: &[SlotDescriptor] = &[];
16799const SYMBOL_ICON_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
16800 id: PropertyId::SymbolIconSymbol,
16801 name: "Symbol",
16802 field: "symbol",
16803 value: "Symbol",
16804 interface: "Microsoft.UI.Xaml.Controls.ISymbolIcon",
16805 clearable: true,
16806 feedback: None,
16807 feedback_contract: None,
16808 observes_feedback: false,
16809}];
16810const SYMBOL_ICON_EVENTS: &[EventDescriptor] = &[];
16811const SYMBOL_ICON_SLOTS: &[SlotDescriptor] = &[];
16812const IMAGE_ICON_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
16813 id: PropertyId::ImageIconSource,
16814 name: "Source",
16815 field: "source",
16816 value: "ImageValue",
16817 interface: "Microsoft.UI.Xaml.Controls.IImageIcon",
16818 clearable: true,
16819 feedback: None,
16820 feedback_contract: None,
16821 observes_feedback: false,
16822}];
16823const IMAGE_ICON_EVENTS: &[EventDescriptor] = &[];
16824const IMAGE_ICON_SLOTS: &[SlotDescriptor] = &[];
16825const FONT_ICON_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
16826 id: PropertyId::FontIconGlyph,
16827 name: "Glyph",
16828 field: "glyph",
16829 value: "Str",
16830 interface: "Microsoft.UI.Xaml.Controls.IFontIcon",
16831 clearable: true,
16832 feedback: None,
16833 feedback_contract: None,
16834 observes_feedback: false,
16835}];
16836const FONT_ICON_EVENTS: &[EventDescriptor] = &[];
16837const FONT_ICON_SLOTS: &[SlotDescriptor] = &[];
16838const BITMAP_ICON_PROPERTIES: &[PropertyDescriptor] = &[
16839 PropertyDescriptor {
16840 id: PropertyId::BitmapIconUriSource,
16841 name: "UriSource",
16842 field: "uri_source",
16843 value: "Str",
16844 interface: "Microsoft.UI.Xaml.Controls.IBitmapIcon",
16845 clearable: true,
16846 feedback: None,
16847 feedback_contract: None,
16848 observes_feedback: false,
16849 },
16850 PropertyDescriptor {
16851 id: PropertyId::BitmapIconShowAsMonochrome,
16852 name: "ShowAsMonochrome",
16853 field: "show_as_monochrome",
16854 value: "Bool",
16855 interface: "Microsoft.UI.Xaml.Controls.IBitmapIcon",
16856 clearable: true,
16857 feedback: None,
16858 feedback_contract: None,
16859 observes_feedback: false,
16860 },
16861];
16862const BITMAP_ICON_EVENTS: &[EventDescriptor] = &[];
16863const BITMAP_ICON_SLOTS: &[SlotDescriptor] = &[];
16864const PATH_ICON_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
16865 id: PropertyId::PathIconData,
16866 name: "Data",
16867 field: "data",
16868 value: "Str",
16869 interface: "Microsoft.UI.Xaml.Controls.IPathIcon",
16870 clearable: true,
16871 feedback: None,
16872 feedback_contract: None,
16873 observes_feedback: false,
16874}];
16875const PATH_ICON_EVENTS: &[EventDescriptor] = &[];
16876const PATH_ICON_SLOTS: &[SlotDescriptor] = &[];
16877const LIST_BOX_ITEM_PROPERTIES: &[PropertyDescriptor] = &[
16878 PropertyDescriptor {
16879 id: PropertyId::ListBoxItemTag,
16880 name: "Tag",
16881 field: "tag",
16882 value: "Str",
16883 interface: "Microsoft.UI.Xaml.IFrameworkElement",
16884 clearable: true,
16885 feedback: None,
16886 feedback_contract: None,
16887 observes_feedback: false,
16888 },
16889 PropertyDescriptor {
16890 id: PropertyId::ListBoxItemIsSelected,
16891 name: "IsSelected",
16892 field: "is_selected",
16893 value: "Bool",
16894 interface: "Microsoft.UI.Xaml.Controls.Primitives.ISelectorItem",
16895 clearable: true,
16896 feedback: None,
16897 feedback_contract: None,
16898 observes_feedback: false,
16899 },
16900];
16901const LIST_BOX_ITEM_EVENTS: &[EventDescriptor] = &[];
16902const LIST_BOX_ITEM_SLOTS: &[SlotDescriptor] = &[];
16903const RATING_CONTROL_PROPERTIES: &[PropertyDescriptor] = &[
16904 PropertyDescriptor {
16905 id: PropertyId::RatingControlMaxRating,
16906 name: "MaxRating",
16907 field: "max_rating",
16908 value: "I32",
16909 interface: "Microsoft.UI.Xaml.Controls.IRatingControl",
16910 clearable: true,
16911 feedback: Some("ValueChanged"),
16912 feedback_contract: Some("synchronous_normalized"),
16913 observes_feedback: false,
16914 },
16915 PropertyDescriptor {
16916 id: PropertyId::RatingControlValue,
16917 name: "Value",
16918 field: "value",
16919 value: "OptionalF64",
16920 interface: "Microsoft.UI.Xaml.Controls.IRatingControl",
16921 clearable: true,
16922 feedback: Some("ValueChanged"),
16923 feedback_contract: Some("synchronous_normalized"),
16924 observes_feedback: true,
16925 },
16926 PropertyDescriptor {
16927 id: PropertyId::RatingControlCaption,
16928 name: "Caption",
16929 field: "caption",
16930 value: "Str",
16931 interface: "Microsoft.UI.Xaml.Controls.IRatingControl",
16932 clearable: true,
16933 feedback: None,
16934 feedback_contract: None,
16935 observes_feedback: false,
16936 },
16937 PropertyDescriptor {
16938 id: PropertyId::RatingControlIsReadOnly,
16939 name: "IsReadOnly",
16940 field: "is_read_only",
16941 value: "Bool",
16942 interface: "Microsoft.UI.Xaml.Controls.IRatingControl",
16943 clearable: true,
16944 feedback: None,
16945 feedback_contract: None,
16946 observes_feedback: false,
16947 },
16948];
16949const RATING_CONTROL_EVENTS: &[EventDescriptor] = &[EventDescriptor {
16950 id: EventId::RatingControlValueChanged,
16951 name: "ValueChanged",
16952 field: "on_value_changed",
16953 payload: "OptionalF64",
16954 interface: "Microsoft.UI.Xaml.Controls.IRatingControl",
16955}];
16956const RATING_CONTROL_SLOTS: &[SlotDescriptor] = &[];
16957const EXPANDER_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
16958 id: PropertyId::ExpanderIsExpanded,
16959 name: "IsExpanded",
16960 field: "is_expanded",
16961 value: "Bool",
16962 interface: "Microsoft.UI.Xaml.Controls.IExpander",
16963 clearable: true,
16964 feedback: Some("IsExpandedChanged"),
16965 feedback_contract: Some("synchronous_exact"),
16966 observes_feedback: true,
16967}];
16968const EXPANDER_EVENTS: &[EventDescriptor] = &[EventDescriptor {
16969 id: EventId::ExpanderIsExpandedChanged,
16970 name: "IsExpandedChanged",
16971 field: "on_is_expanded_changed",
16972 payload: "Bool",
16973 interface: "Microsoft.UI.Xaml.Controls.IExpander",
16974}];
16975const EXPANDER_SLOTS: &[SlotDescriptor] = &[
16976 SlotDescriptor {
16977 id: SlotId::ExpanderHeader,
16978 name: "Header",
16979 interface: "Microsoft.UI.Xaml.Controls.IExpander",
16980 target: "inspectable",
16981 collection: false,
16982 },
16983 SlotDescriptor {
16984 id: SlotId::ExpanderContent,
16985 name: "Content",
16986 interface: "Microsoft.UI.Xaml.Controls.IContentControl",
16987 target: "inspectable",
16988 collection: false,
16989 },
16990];
16991const COMBO_BOX_PROPERTIES: &[PropertyDescriptor] = &[
16992 PropertyDescriptor {
16993 id: PropertyId::ComboBoxItemsSource,
16994 name: "ItemsSource",
16995 field: "items_source",
16996 value: "StrList",
16997 interface: "Microsoft.UI.Xaml.Controls.IItemsControl",
16998 clearable: true,
16999 feedback: None,
17000 feedback_contract: None,
17001 observes_feedback: false,
17002 },
17003 PropertyDescriptor {
17004 id: PropertyId::ComboBoxSelectedIndex,
17005 name: "SelectedIndex",
17006 field: "selected_index",
17007 value: "SelectionIndex",
17008 interface: "Microsoft.UI.Xaml.Controls.Primitives.ISelector",
17009 clearable: true,
17010 feedback: Some("SelectionChanged"),
17011 feedback_contract: Some("synchronous_exact"),
17012 observes_feedback: true,
17013 },
17014 PropertyDescriptor {
17015 id: PropertyId::ComboBoxPlaceholderText,
17016 name: "PlaceholderText",
17017 field: "placeholder_text",
17018 value: "Str",
17019 interface: "Microsoft.UI.Xaml.Controls.IComboBox",
17020 clearable: true,
17021 feedback: None,
17022 feedback_contract: None,
17023 observes_feedback: false,
17024 },
17025 PropertyDescriptor {
17026 id: PropertyId::ComboBoxIsEditable,
17027 name: "IsEditable",
17028 field: "is_editable",
17029 value: "Bool",
17030 interface: "Microsoft.UI.Xaml.Controls.IComboBox",
17031 clearable: true,
17032 feedback: None,
17033 feedback_contract: None,
17034 observes_feedback: false,
17035 },
17036 PropertyDescriptor {
17037 id: PropertyId::ComboBoxIsEnabled,
17038 name: "IsEnabled",
17039 field: "is_enabled",
17040 value: "Bool",
17041 interface: "Microsoft.UI.Xaml.Controls.IControl",
17042 clearable: true,
17043 feedback: None,
17044 feedback_contract: None,
17045 observes_feedback: false,
17046 },
17047];
17048const COMBO_BOX_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17049 id: EventId::ComboBoxSelectionChanged,
17050 name: "SelectionChanged",
17051 field: "on_selection_changed",
17052 payload: "SelectionIndex",
17053 interface: "Microsoft.UI.Xaml.Controls.Primitives.ISelector",
17054}];
17055const COMBO_BOX_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17056 id: SlotId::ComboBoxHeader,
17057 name: "Header",
17058 interface: "Microsoft.UI.Xaml.Controls.IComboBox",
17059 target: "inspectable",
17060 collection: false,
17061}];
17062const PIVOT_PROPERTIES: &[PropertyDescriptor] = &[
17063 PropertyDescriptor {
17064 id: PropertyId::PivotSelectedIndex,
17065 name: "SelectedIndex",
17066 field: "selected_index",
17067 value: "SelectionIndex",
17068 interface: "Microsoft.UI.Xaml.Controls.IPivot",
17069 clearable: true,
17070 feedback: Some("SelectionChanged"),
17071 feedback_contract: Some("synchronous_exact"),
17072 observes_feedback: true,
17073 },
17074 PropertyDescriptor {
17075 id: PropertyId::PivotTitle,
17076 name: "Title",
17077 field: "title",
17078 value: "Str",
17079 interface: "Microsoft.UI.Xaml.Controls.IPivot",
17080 clearable: true,
17081 feedback: None,
17082 feedback_contract: None,
17083 observes_feedback: false,
17084 },
17085];
17086const PIVOT_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17087 id: EventId::PivotSelectionChanged,
17088 name: "SelectionChanged",
17089 field: "on_selection_changed",
17090 payload: "SelectionIndex",
17091 interface: "Microsoft.UI.Xaml.Controls.IPivot",
17092}];
17093const PIVOT_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17094 id: SlotId::PivotItems,
17095 name: "Items",
17096 interface: "Microsoft.UI.Xaml.Controls.IItemsControl",
17097 target: "inspectable",
17098 collection: true,
17099}];
17100const PIVOT_ITEM_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
17101 id: PropertyId::PivotItemHeader,
17102 name: "Header",
17103 field: "header",
17104 value: "Str",
17105 interface: "Microsoft.UI.Xaml.Controls.IPivotItem",
17106 clearable: true,
17107 feedback: None,
17108 feedback_contract: None,
17109 observes_feedback: false,
17110}];
17111const PIVOT_ITEM_EVENTS: &[EventDescriptor] = &[];
17112const PIVOT_ITEM_SLOTS: &[SlotDescriptor] = &[];
17113const FLIP_VIEW_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
17114 id: PropertyId::FlipViewSelectedIndex,
17115 name: "SelectedIndex",
17116 field: "selected_index",
17117 value: "SelectionIndex",
17118 interface: "Microsoft.UI.Xaml.Controls.Primitives.ISelector",
17119 clearable: true,
17120 feedback: Some("SelectionChanged"),
17121 feedback_contract: Some("synchronous_exact"),
17122 observes_feedback: true,
17123}];
17124const FLIP_VIEW_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17125 id: EventId::FlipViewSelectionChanged,
17126 name: "SelectionChanged",
17127 field: "on_selection_changed",
17128 payload: "SelectionIndex",
17129 interface: "Microsoft.UI.Xaml.Controls.Primitives.ISelector",
17130}];
17131const FLIP_VIEW_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17132 id: SlotId::FlipViewItems,
17133 name: "Items",
17134 interface: "Microsoft.UI.Xaml.Controls.IItemsControl",
17135 target: "inspectable",
17136 collection: true,
17137}];
17138const SELECTOR_BAR_PROPERTIES: &[PropertyDescriptor] = &[];
17139const SELECTOR_BAR_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17140 id: EventId::SelectorBarSelectionChanged,
17141 name: "SelectionChanged",
17142 field: "on_selected_text_changed",
17143 payload: "SelectionChange",
17144 interface: "Microsoft.UI.Xaml.Controls.ISelectorBar",
17145}];
17146const SELECTOR_BAR_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17147 id: SlotId::SelectorBarItems,
17148 name: "Items",
17149 interface: "Microsoft.UI.Xaml.Controls.ISelectorBar",
17150 target: "inspectable",
17151 collection: true,
17152}];
17153const SELECTOR_BAR_ITEM_PROPERTIES: &[PropertyDescriptor] = &[
17154 PropertyDescriptor {
17155 id: PropertyId::SelectorBarItemText,
17156 name: "Text",
17157 field: "text",
17158 value: "Str",
17159 interface: "Microsoft.UI.Xaml.Controls.ISelectorBarItem",
17160 clearable: true,
17161 feedback: None,
17162 feedback_contract: None,
17163 observes_feedback: false,
17164 },
17165 PropertyDescriptor {
17166 id: PropertyId::SelectorBarItemIsSelected,
17167 name: "IsSelected",
17168 field: "is_selected",
17169 value: "Bool",
17170 interface: "Microsoft.UI.Xaml.Controls.IItemContainer",
17171 clearable: true,
17172 feedback: None,
17173 feedback_contract: None,
17174 observes_feedback: false,
17175 },
17176];
17177const SELECTOR_BAR_ITEM_EVENTS: &[EventDescriptor] = &[];
17178const SELECTOR_BAR_ITEM_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17179 id: SlotId::SelectorBarItemIcon,
17180 name: "Icon",
17181 interface: "Microsoft.UI.Xaml.Controls.ISelectorBarItem",
17182 target: "icon_element",
17183 collection: false,
17184}];
17185const TAB_VIEW_PROPERTIES: &[PropertyDescriptor] = &[
17186 PropertyDescriptor {
17187 id: PropertyId::TabViewSelectedIndex,
17188 name: "SelectedIndex",
17189 field: "selected_index",
17190 value: "SelectionIndex",
17191 interface: "Microsoft.UI.Xaml.Controls.ITabView",
17192 clearable: true,
17193 feedback: Some("SelectionChanged"),
17194 feedback_contract: Some("synchronous_exact"),
17195 observes_feedback: true,
17196 },
17197 PropertyDescriptor {
17198 id: PropertyId::TabViewCanReorderTabs,
17199 name: "CanReorderTabs",
17200 field: "can_reorder_tabs",
17201 value: "Bool",
17202 interface: "Microsoft.UI.Xaml.Controls.ITabView",
17203 clearable: true,
17204 feedback: None,
17205 feedback_contract: None,
17206 observes_feedback: false,
17207 },
17208 PropertyDescriptor {
17209 id: PropertyId::TabViewIsAddTabButtonVisible,
17210 name: "IsAddTabButtonVisible",
17211 field: "is_add_tab_button_visible",
17212 value: "Bool",
17213 interface: "Microsoft.UI.Xaml.Controls.ITabView",
17214 clearable: true,
17215 feedback: None,
17216 feedback_contract: None,
17217 observes_feedback: false,
17218 },
17219];
17220const TAB_VIEW_EVENTS: &[EventDescriptor] = &[
17221 EventDescriptor {
17222 id: EventId::TabViewSelectionChanged,
17223 name: "SelectionChanged",
17224 field: "on_selection_changed",
17225 payload: "SelectionIndex",
17226 interface: "Microsoft.UI.Xaml.Controls.ITabView",
17227 },
17228 EventDescriptor {
17229 id: EventId::TabViewTabCloseRequested,
17230 name: "TabCloseRequested",
17231 field: "on_close_requested",
17232 payload: "Str",
17233 interface: "Microsoft.UI.Xaml.Controls.ITabView",
17234 },
17235 EventDescriptor {
17236 id: EventId::TabViewAddTabButtonClick,
17237 name: "AddTabButtonClick",
17238 field: "on_add_tab_button_click",
17239 payload: "Unit",
17240 interface: "Microsoft.UI.Xaml.Controls.ITabView",
17241 },
17242 EventDescriptor {
17243 id: EventId::TabViewTabItemsChanged,
17244 name: "TabItemsChanged",
17245 field: "on_reordered",
17246 payload: "StrList",
17247 interface: "Microsoft.UI.Xaml.Controls.ITabView",
17248 },
17249];
17250const TAB_VIEW_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17251 id: SlotId::TabViewTabItems,
17252 name: "TabItems",
17253 interface: "Microsoft.UI.Xaml.Controls.ITabView",
17254 target: "inspectable",
17255 collection: true,
17256}];
17257const TAB_VIEW_ITEM_PROPERTIES: &[PropertyDescriptor] = &[
17258 PropertyDescriptor {
17259 id: PropertyId::TabViewItemHeader,
17260 name: "Header",
17261 field: "header",
17262 value: "Str",
17263 interface: "Microsoft.UI.Xaml.Controls.ITabViewItem",
17264 clearable: true,
17265 feedback: None,
17266 feedback_contract: None,
17267 observes_feedback: false,
17268 },
17269 PropertyDescriptor {
17270 id: PropertyId::TabViewItemIsClosable,
17271 name: "IsClosable",
17272 field: "is_closable",
17273 value: "Bool",
17274 interface: "Microsoft.UI.Xaml.Controls.ITabViewItem",
17275 clearable: true,
17276 feedback: None,
17277 feedback_contract: None,
17278 observes_feedback: false,
17279 },
17280 PropertyDescriptor {
17281 id: PropertyId::TabViewItemTag,
17282 name: "Tag",
17283 field: "tag",
17284 value: "Str",
17285 interface: "Microsoft.UI.Xaml.IFrameworkElement",
17286 clearable: true,
17287 feedback: None,
17288 feedback_contract: None,
17289 observes_feedback: false,
17290 },
17291];
17292const TAB_VIEW_ITEM_EVENTS: &[EventDescriptor] = &[];
17293const TAB_VIEW_ITEM_SLOTS: &[SlotDescriptor] = &[];
17294const TEACHING_TIP_PROPERTIES: &[PropertyDescriptor] = &[
17295 PropertyDescriptor {
17296 id: PropertyId::TeachingTipTitle,
17297 name: "Title",
17298 field: "title",
17299 value: "Str",
17300 interface: "Microsoft.UI.Xaml.Controls.ITeachingTip",
17301 clearable: true,
17302 feedback: None,
17303 feedback_contract: None,
17304 observes_feedback: false,
17305 },
17306 PropertyDescriptor {
17307 id: PropertyId::TeachingTipSubtitle,
17308 name: "Subtitle",
17309 field: "subtitle",
17310 value: "Str",
17311 interface: "Microsoft.UI.Xaml.Controls.ITeachingTip",
17312 clearable: true,
17313 feedback: None,
17314 feedback_contract: None,
17315 observes_feedback: false,
17316 },
17317 PropertyDescriptor {
17318 id: PropertyId::TeachingTipIsOpen,
17319 name: "IsOpen",
17320 field: "is_open",
17321 value: "Bool",
17322 interface: "Microsoft.UI.Xaml.Controls.ITeachingTip",
17323 clearable: true,
17324 feedback: None,
17325 feedback_contract: None,
17326 observes_feedback: false,
17327 },
17328 PropertyDescriptor {
17329 id: PropertyId::TeachingTipIsLightDismissEnabled,
17330 name: "IsLightDismissEnabled",
17331 field: "is_light_dismiss_enabled",
17332 value: "Bool",
17333 interface: "Microsoft.UI.Xaml.Controls.ITeachingTip",
17334 clearable: true,
17335 feedback: None,
17336 feedback_contract: None,
17337 observes_feedback: false,
17338 },
17339 PropertyDescriptor {
17340 id: PropertyId::TeachingTipPreferredPlacement,
17341 name: "PreferredPlacement",
17342 field: "preferred_placement",
17343 value: "TeachingTipPlacementMode",
17344 interface: "Microsoft.UI.Xaml.Controls.ITeachingTip",
17345 clearable: true,
17346 feedback: None,
17347 feedback_contract: None,
17348 observes_feedback: false,
17349 },
17350 PropertyDescriptor {
17351 id: PropertyId::TeachingTipActionButtonContent,
17352 name: "ActionButtonContent",
17353 field: "action_button_content",
17354 value: "Str",
17355 interface: "Microsoft.UI.Xaml.Controls.ITeachingTip",
17356 clearable: true,
17357 feedback: None,
17358 feedback_contract: None,
17359 observes_feedback: false,
17360 },
17361 PropertyDescriptor {
17362 id: PropertyId::TeachingTipCloseButtonContent,
17363 name: "CloseButtonContent",
17364 field: "close_button_content",
17365 value: "Str",
17366 interface: "Microsoft.UI.Xaml.Controls.ITeachingTip",
17367 clearable: true,
17368 feedback: None,
17369 feedback_contract: None,
17370 observes_feedback: false,
17371 },
17372];
17373const TEACHING_TIP_EVENTS: &[EventDescriptor] = &[
17374 EventDescriptor {
17375 id: EventId::TeachingTipClosed,
17376 name: "Closed",
17377 field: "on_closed",
17378 payload: "Unit",
17379 interface: "Microsoft.UI.Xaml.Controls.ITeachingTip",
17380 },
17381 EventDescriptor {
17382 id: EventId::TeachingTipActionButtonClick,
17383 name: "ActionButtonClick",
17384 field: "on_action_button_click",
17385 payload: "Unit",
17386 interface: "Microsoft.UI.Xaml.Controls.ITeachingTip",
17387 },
17388];
17389const TEACHING_TIP_SLOTS: &[SlotDescriptor] = &[];
17390const DROP_DOWN_BUTTON_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
17391 id: PropertyId::DropDownButtonIsEnabled,
17392 name: "IsEnabled",
17393 field: "is_enabled",
17394 value: "Bool",
17395 interface: "Microsoft.UI.Xaml.Controls.IControl",
17396 clearable: true,
17397 feedback: None,
17398 feedback_contract: None,
17399 observes_feedback: false,
17400}];
17401const DROP_DOWN_BUTTON_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17402 id: EventId::DropDownButtonClick,
17403 name: "Click",
17404 field: "on_click",
17405 payload: "Unit",
17406 interface: "Microsoft.UI.Xaml.Controls.Primitives.IButtonBase",
17407}];
17408const DROP_DOWN_BUTTON_SLOTS: &[SlotDescriptor] = &[];
17409const COMMAND_BAR_PROPERTIES: &[PropertyDescriptor] = &[];
17410const COMMAND_BAR_EVENTS: &[EventDescriptor] = &[];
17411const COMMAND_BAR_SLOTS: &[SlotDescriptor] = &[
17412 SlotDescriptor {
17413 id: SlotId::CommandBarPrimaryCommands,
17414 name: "PrimaryCommands",
17415 interface: "Microsoft.UI.Xaml.Controls.ICommandBar",
17416 target: "inspectable",
17417 collection: true,
17418 },
17419 SlotDescriptor {
17420 id: SlotId::CommandBarSecondaryCommands,
17421 name: "SecondaryCommands",
17422 interface: "Microsoft.UI.Xaml.Controls.ICommandBar",
17423 target: "inspectable",
17424 collection: true,
17425 },
17426];
17427const APP_BAR_BUTTON_PROPERTIES: &[PropertyDescriptor] = &[
17428 PropertyDescriptor {
17429 id: PropertyId::AppBarButtonLabel,
17430 name: "Label",
17431 field: "label",
17432 value: "Str",
17433 interface: "Microsoft.UI.Xaml.Controls.IAppBarButton",
17434 clearable: true,
17435 feedback: None,
17436 feedback_contract: None,
17437 observes_feedback: false,
17438 },
17439 PropertyDescriptor {
17440 id: PropertyId::AppBarButtonIsEnabled,
17441 name: "IsEnabled",
17442 field: "is_enabled",
17443 value: "Bool",
17444 interface: "Microsoft.UI.Xaml.Controls.IControl",
17445 clearable: true,
17446 feedback: None,
17447 feedback_contract: None,
17448 observes_feedback: false,
17449 },
17450];
17451const APP_BAR_BUTTON_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17452 id: EventId::AppBarButtonClick,
17453 name: "Click",
17454 field: "on_click",
17455 payload: "Unit",
17456 interface: "Microsoft.UI.Xaml.Controls.Primitives.IButtonBase",
17457}];
17458const APP_BAR_BUTTON_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17459 id: SlotId::AppBarButtonIcon,
17460 name: "Icon",
17461 interface: "Microsoft.UI.Xaml.Controls.IAppBarButton",
17462 target: "icon_element",
17463 collection: false,
17464}];
17465const APP_BAR_SEPARATOR_PROPERTIES: &[PropertyDescriptor] = &[];
17466const APP_BAR_SEPARATOR_EVENTS: &[EventDescriptor] = &[];
17467const APP_BAR_SEPARATOR_SLOTS: &[SlotDescriptor] = &[];
17468const MENU_BAR_PROPERTIES: &[PropertyDescriptor] = &[];
17469const MENU_BAR_EVENTS: &[EventDescriptor] = &[];
17470const MENU_BAR_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17471 id: SlotId::MenuBarItems,
17472 name: "Items",
17473 interface: "Microsoft.UI.Xaml.Controls.IMenuBar",
17474 target: "inspectable",
17475 collection: true,
17476}];
17477const MENU_BAR_ITEM_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
17478 id: PropertyId::MenuBarItemTitle,
17479 name: "Title",
17480 field: "title",
17481 value: "Str",
17482 interface: "Microsoft.UI.Xaml.Controls.IMenuBarItem",
17483 clearable: true,
17484 feedback: None,
17485 feedback_contract: None,
17486 observes_feedback: false,
17487}];
17488const MENU_BAR_ITEM_EVENTS: &[EventDescriptor] = &[];
17489const MENU_BAR_ITEM_SLOTS: &[SlotDescriptor] = &[];
17490const SPLIT_BUTTON_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
17491 id: PropertyId::SplitButtonIsEnabled,
17492 name: "IsEnabled",
17493 field: "is_enabled",
17494 value: "Bool",
17495 interface: "Microsoft.UI.Xaml.Controls.IControl",
17496 clearable: true,
17497 feedback: None,
17498 feedback_contract: None,
17499 observes_feedback: false,
17500}];
17501const SPLIT_BUTTON_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17502 id: EventId::SplitButtonClick,
17503 name: "Click",
17504 field: "on_click",
17505 payload: "Unit",
17506 interface: "Microsoft.UI.Xaml.Controls.ISplitButton",
17507}];
17508const SPLIT_BUTTON_SLOTS: &[SlotDescriptor] = &[];
17509const COLOR_PICKER_PROPERTIES: &[PropertyDescriptor] = &[
17510 PropertyDescriptor {
17511 id: PropertyId::ColorPickerColor,
17512 name: "Color",
17513 field: "color",
17514 value: "Color",
17515 interface: "Microsoft.UI.Xaml.Controls.IColorPicker",
17516 clearable: true,
17517 feedback: Some("ColorChanged"),
17518 feedback_contract: Some("synchronous_exact"),
17519 observes_feedback: true,
17520 },
17521 PropertyDescriptor {
17522 id: PropertyId::ColorPickerIsAlphaEnabled,
17523 name: "IsAlphaEnabled",
17524 field: "is_alpha_enabled",
17525 value: "Bool",
17526 interface: "Microsoft.UI.Xaml.Controls.IColorPicker",
17527 clearable: true,
17528 feedback: None,
17529 feedback_contract: None,
17530 observes_feedback: false,
17531 },
17532 PropertyDescriptor {
17533 id: PropertyId::ColorPickerIsHexInputVisible,
17534 name: "IsHexInputVisible",
17535 field: "is_hex_input_visible",
17536 value: "Bool",
17537 interface: "Microsoft.UI.Xaml.Controls.IColorPicker",
17538 clearable: true,
17539 feedback: None,
17540 feedback_contract: None,
17541 observes_feedback: false,
17542 },
17543 PropertyDescriptor {
17544 id: PropertyId::ColorPickerIsColorSliderVisible,
17545 name: "IsColorSliderVisible",
17546 field: "is_color_slider_visible",
17547 value: "Bool",
17548 interface: "Microsoft.UI.Xaml.Controls.IColorPicker",
17549 clearable: true,
17550 feedback: None,
17551 feedback_contract: None,
17552 observes_feedback: false,
17553 },
17554 PropertyDescriptor {
17555 id: PropertyId::ColorPickerIsColorChannelTextInputVisible,
17556 name: "IsColorChannelTextInputVisible",
17557 field: "is_color_channel_text_input_visible",
17558 value: "Bool",
17559 interface: "Microsoft.UI.Xaml.Controls.IColorPicker",
17560 clearable: true,
17561 feedback: None,
17562 feedback_contract: None,
17563 observes_feedback: false,
17564 },
17565 PropertyDescriptor {
17566 id: PropertyId::ColorPickerIsEnabled,
17567 name: "IsEnabled",
17568 field: "is_enabled",
17569 value: "Bool",
17570 interface: "Microsoft.UI.Xaml.Controls.IControl",
17571 clearable: true,
17572 feedback: None,
17573 feedback_contract: None,
17574 observes_feedback: false,
17575 },
17576];
17577const COLOR_PICKER_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17578 id: EventId::ColorPickerColorChanged,
17579 name: "ColorChanged",
17580 field: "on_color_changed",
17581 payload: "Color",
17582 interface: "Microsoft.UI.Xaml.Controls.IColorPicker",
17583}];
17584const COLOR_PICKER_SLOTS: &[SlotDescriptor] = &[];
17585const DATE_PICKER_PROPERTIES: &[PropertyDescriptor] = &[
17586 PropertyDescriptor {
17587 id: PropertyId::DatePickerDayVisible,
17588 name: "DayVisible",
17589 field: "day_visible",
17590 value: "Bool",
17591 interface: "Microsoft.UI.Xaml.Controls.IDatePicker",
17592 clearable: true,
17593 feedback: None,
17594 feedback_contract: None,
17595 observes_feedback: false,
17596 },
17597 PropertyDescriptor {
17598 id: PropertyId::DatePickerMonthVisible,
17599 name: "MonthVisible",
17600 field: "month_visible",
17601 value: "Bool",
17602 interface: "Microsoft.UI.Xaml.Controls.IDatePicker",
17603 clearable: true,
17604 feedback: None,
17605 feedback_contract: None,
17606 observes_feedback: false,
17607 },
17608 PropertyDescriptor {
17609 id: PropertyId::DatePickerYearVisible,
17610 name: "YearVisible",
17611 field: "year_visible",
17612 value: "Bool",
17613 interface: "Microsoft.UI.Xaml.Controls.IDatePicker",
17614 clearable: true,
17615 feedback: None,
17616 feedback_contract: None,
17617 observes_feedback: false,
17618 },
17619 PropertyDescriptor {
17620 id: PropertyId::DatePickerIsEnabled,
17621 name: "IsEnabled",
17622 field: "is_enabled",
17623 value: "Bool",
17624 interface: "Microsoft.UI.Xaml.Controls.IControl",
17625 clearable: true,
17626 feedback: None,
17627 feedback_contract: None,
17628 observes_feedback: false,
17629 },
17630];
17631const DATE_PICKER_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17632 id: EventId::DatePickerSelectedDateChanged,
17633 name: "SelectedDateChanged",
17634 field: "on_selected_date_changed",
17635 payload: "OptionalDateTime",
17636 interface: "Microsoft.UI.Xaml.Controls.IDatePicker",
17637}];
17638const DATE_PICKER_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17639 id: SlotId::DatePickerHeader,
17640 name: "Header",
17641 interface: "Microsoft.UI.Xaml.Controls.IDatePicker",
17642 target: "inspectable",
17643 collection: false,
17644}];
17645const TIME_PICKER_PROPERTIES: &[PropertyDescriptor] = &[
17646 PropertyDescriptor {
17647 id: PropertyId::TimePickerClockIdentifier,
17648 name: "ClockIdentifier",
17649 field: "clock_identifier",
17650 value: "Str",
17651 interface: "Microsoft.UI.Xaml.Controls.ITimePicker",
17652 clearable: true,
17653 feedback: None,
17654 feedback_contract: None,
17655 observes_feedback: false,
17656 },
17657 PropertyDescriptor {
17658 id: PropertyId::TimePickerMinuteIncrement,
17659 name: "MinuteIncrement",
17660 field: "minute_increment",
17661 value: "I32",
17662 interface: "Microsoft.UI.Xaml.Controls.ITimePicker",
17663 clearable: true,
17664 feedback: None,
17665 feedback_contract: None,
17666 observes_feedback: false,
17667 },
17668 PropertyDescriptor {
17669 id: PropertyId::TimePickerIsEnabled,
17670 name: "IsEnabled",
17671 field: "is_enabled",
17672 value: "Bool",
17673 interface: "Microsoft.UI.Xaml.Controls.IControl",
17674 clearable: true,
17675 feedback: None,
17676 feedback_contract: None,
17677 observes_feedback: false,
17678 },
17679];
17680const TIME_PICKER_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17681 id: EventId::TimePickerSelectedTimeChanged,
17682 name: "SelectedTimeChanged",
17683 field: "on_selected_time_changed",
17684 payload: "OptionalTimeSpan",
17685 interface: "Microsoft.UI.Xaml.Controls.ITimePicker",
17686}];
17687const TIME_PICKER_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17688 id: SlotId::TimePickerHeader,
17689 name: "Header",
17690 interface: "Microsoft.UI.Xaml.Controls.ITimePicker",
17691 target: "inspectable",
17692 collection: false,
17693}];
17694const CALENDAR_DATE_PICKER_PROPERTIES: &[PropertyDescriptor] = &[
17695 PropertyDescriptor {
17696 id: PropertyId::CalendarDatePickerPlaceholderText,
17697 name: "PlaceholderText",
17698 field: "placeholder_text",
17699 value: "Str",
17700 interface: "Microsoft.UI.Xaml.Controls.ICalendarDatePicker",
17701 clearable: true,
17702 feedback: None,
17703 feedback_contract: None,
17704 observes_feedback: false,
17705 },
17706 PropertyDescriptor {
17707 id: PropertyId::CalendarDatePickerIsTodayHighlighted,
17708 name: "IsTodayHighlighted",
17709 field: "is_today_highlighted",
17710 value: "Bool",
17711 interface: "Microsoft.UI.Xaml.Controls.ICalendarDatePicker",
17712 clearable: true,
17713 feedback: None,
17714 feedback_contract: None,
17715 observes_feedback: false,
17716 },
17717 PropertyDescriptor {
17718 id: PropertyId::CalendarDatePickerIsCalendarOpen,
17719 name: "IsCalendarOpen",
17720 field: "is_calendar_open",
17721 value: "Bool",
17722 interface: "Microsoft.UI.Xaml.Controls.ICalendarDatePicker",
17723 clearable: true,
17724 feedback: None,
17725 feedback_contract: None,
17726 observes_feedback: false,
17727 },
17728 PropertyDescriptor {
17729 id: PropertyId::CalendarDatePickerIsEnabled,
17730 name: "IsEnabled",
17731 field: "is_enabled",
17732 value: "Bool",
17733 interface: "Microsoft.UI.Xaml.Controls.IControl",
17734 clearable: true,
17735 feedback: None,
17736 feedback_contract: None,
17737 observes_feedback: false,
17738 },
17739];
17740const CALENDAR_DATE_PICKER_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17741 id: EventId::CalendarDatePickerDateChanged,
17742 name: "DateChanged",
17743 field: "on_date_changed",
17744 payload: "OptionalDateTime",
17745 interface: "Microsoft.UI.Xaml.Controls.ICalendarDatePicker",
17746}];
17747const CALENDAR_DATE_PICKER_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17748 id: SlotId::CalendarDatePickerHeader,
17749 name: "Header",
17750 interface: "Microsoft.UI.Xaml.Controls.ICalendarDatePicker",
17751 target: "inspectable",
17752 collection: false,
17753}];
17754const TOOL_TIP_PROPERTIES: &[PropertyDescriptor] = &[];
17755const TOOL_TIP_EVENTS: &[EventDescriptor] = &[];
17756const TOOL_TIP_SLOTS: &[SlotDescriptor] = &[];
17757const CONTENT_DIALOG_PROPERTIES: &[PropertyDescriptor] = &[
17758 PropertyDescriptor {
17759 id: PropertyId::ContentDialogTitle,
17760 name: "Title",
17761 field: "title",
17762 value: "Str",
17763 interface: "Microsoft.UI.Xaml.Controls.IContentDialog",
17764 clearable: true,
17765 feedback: None,
17766 feedback_contract: None,
17767 observes_feedback: false,
17768 },
17769 PropertyDescriptor {
17770 id: PropertyId::ContentDialogPrimaryButtonText,
17771 name: "PrimaryButtonText",
17772 field: "primary_button_text",
17773 value: "Str",
17774 interface: "Microsoft.UI.Xaml.Controls.IContentDialog",
17775 clearable: true,
17776 feedback: None,
17777 feedback_contract: None,
17778 observes_feedback: false,
17779 },
17780 PropertyDescriptor {
17781 id: PropertyId::ContentDialogSecondaryButtonText,
17782 name: "SecondaryButtonText",
17783 field: "secondary_button_text",
17784 value: "Str",
17785 interface: "Microsoft.UI.Xaml.Controls.IContentDialog",
17786 clearable: true,
17787 feedback: None,
17788 feedback_contract: None,
17789 observes_feedback: false,
17790 },
17791 PropertyDescriptor {
17792 id: PropertyId::ContentDialogCloseButtonText,
17793 name: "CloseButtonText",
17794 field: "close_button_text",
17795 value: "Str",
17796 interface: "Microsoft.UI.Xaml.Controls.IContentDialog",
17797 clearable: true,
17798 feedback: None,
17799 feedback_contract: None,
17800 observes_feedback: false,
17801 },
17802 PropertyDescriptor {
17803 id: PropertyId::ContentDialogIsPrimaryButtonEnabled,
17804 name: "IsPrimaryButtonEnabled",
17805 field: "is_primary_button_enabled",
17806 value: "Bool",
17807 interface: "Microsoft.UI.Xaml.Controls.IContentDialog",
17808 clearable: true,
17809 feedback: None,
17810 feedback_contract: None,
17811 observes_feedback: false,
17812 },
17813 PropertyDescriptor {
17814 id: PropertyId::ContentDialogIsSecondaryButtonEnabled,
17815 name: "IsSecondaryButtonEnabled",
17816 field: "is_secondary_button_enabled",
17817 value: "Bool",
17818 interface: "Microsoft.UI.Xaml.Controls.IContentDialog",
17819 clearable: true,
17820 feedback: None,
17821 feedback_contract: None,
17822 observes_feedback: false,
17823 },
17824];
17825const CONTENT_DIALOG_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17826 id: EventId::ContentDialogClosed,
17827 name: "Closed",
17828 field: "on_closed",
17829 payload: "ContentDialogResult",
17830 interface: "Microsoft.UI.Xaml.Controls.IContentDialog",
17831}];
17832const CONTENT_DIALOG_SLOTS: &[SlotDescriptor] = &[];
17833const CALENDAR_VIEW_PROPERTIES: &[PropertyDescriptor] = &[
17834 PropertyDescriptor {
17835 id: PropertyId::CalendarViewIsTodayHighlighted,
17836 name: "IsTodayHighlighted",
17837 field: "is_today_highlighted",
17838 value: "Bool",
17839 interface: "Microsoft.UI.Xaml.Controls.ICalendarView",
17840 clearable: true,
17841 feedback: None,
17842 feedback_contract: None,
17843 observes_feedback: false,
17844 },
17845 PropertyDescriptor {
17846 id: PropertyId::CalendarViewIsGroupLabelVisible,
17847 name: "IsGroupLabelVisible",
17848 field: "is_group_label_visible",
17849 value: "Bool",
17850 interface: "Microsoft.UI.Xaml.Controls.ICalendarView",
17851 clearable: true,
17852 feedback: None,
17853 feedback_contract: None,
17854 observes_feedback: false,
17855 },
17856 PropertyDescriptor {
17857 id: PropertyId::CalendarViewIsEnabled,
17858 name: "IsEnabled",
17859 field: "is_enabled",
17860 value: "Bool",
17861 interface: "Microsoft.UI.Xaml.Controls.IControl",
17862 clearable: true,
17863 feedback: None,
17864 feedback_contract: None,
17865 observes_feedback: false,
17866 },
17867];
17868const CALENDAR_VIEW_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17869 id: EventId::CalendarViewSelectedDatesChanged,
17870 name: "SelectedDatesChanged",
17871 field: "on_selected_dates_changed",
17872 payload: "Unit",
17873 interface: "Microsoft.UI.Xaml.Controls.ICalendarView",
17874}];
17875const CALENDAR_VIEW_SLOTS: &[SlotDescriptor] = &[];
17876const LIST_VIEW_PROPERTIES: &[PropertyDescriptor] = &[
17877 PropertyDescriptor {
17878 id: PropertyId::ListViewSelectedIndex,
17879 name: "SelectedIndex",
17880 field: "selected_index",
17881 value: "SelectionIndex",
17882 interface: "Microsoft.UI.Xaml.Controls.Primitives.ISelector",
17883 clearable: true,
17884 feedback: Some("SelectionChanged"),
17885 feedback_contract: Some("synchronous_exact"),
17886 observes_feedback: true,
17887 },
17888 PropertyDescriptor {
17889 id: PropertyId::ListViewSelectionMode,
17890 name: "SelectionMode",
17891 field: "selection_mode",
17892 value: "ListViewSelectionMode",
17893 interface: "Microsoft.UI.Xaml.Controls.IListViewBase",
17894 clearable: true,
17895 feedback: None,
17896 feedback_contract: None,
17897 observes_feedback: false,
17898 },
17899 PropertyDescriptor {
17900 id: PropertyId::ListViewCanDragItems,
17901 name: "CanDragItems",
17902 field: "can_drag_items",
17903 value: "Bool",
17904 interface: "Microsoft.UI.Xaml.Controls.IListViewBase",
17905 clearable: true,
17906 feedback: None,
17907 feedback_contract: None,
17908 observes_feedback: false,
17909 },
17910 PropertyDescriptor {
17911 id: PropertyId::ListViewCanReorderItems,
17912 name: "CanReorderItems",
17913 field: "can_reorder_items",
17914 value: "Bool",
17915 interface: "Microsoft.UI.Xaml.Controls.IListViewBase",
17916 clearable: true,
17917 feedback: None,
17918 feedback_contract: None,
17919 observes_feedback: false,
17920 },
17921 PropertyDescriptor {
17922 id: PropertyId::ListViewAllowDrop,
17923 name: "AllowDrop",
17924 field: "allow_drop",
17925 value: "Bool",
17926 interface: "Microsoft.UI.Xaml.IUIElement",
17927 clearable: true,
17928 feedback: None,
17929 feedback_contract: None,
17930 observes_feedback: false,
17931 },
17932];
17933const LIST_VIEW_EVENTS: &[EventDescriptor] = &[
17934 EventDescriptor {
17935 id: EventId::ListViewSelectionChanged,
17936 name: "SelectionChanged",
17937 field: "on_selection_changed",
17938 payload: "SelectionIndex",
17939 interface: "Microsoft.UI.Xaml.Controls.Primitives.ISelector",
17940 },
17941 EventDescriptor {
17942 id: EventId::ListViewDragItemsCompleted,
17943 name: "DragItemsCompleted",
17944 field: "on_reordered",
17945 payload: "StrList",
17946 interface: "Microsoft.UI.Xaml.Controls.IListViewBase",
17947 },
17948];
17949const LIST_VIEW_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
17950 id: SlotId::ListViewItems,
17951 name: "Items",
17952 interface: "Microsoft.UI.Xaml.Controls.IItemsControl",
17953 target: "inspectable",
17954 collection: true,
17955}];
17956const LIST_VIEW_ITEM_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
17957 id: PropertyId::ListViewItemTag,
17958 name: "Tag",
17959 field: "tag",
17960 value: "Str",
17961 interface: "Microsoft.UI.Xaml.IFrameworkElement",
17962 clearable: true,
17963 feedback: None,
17964 feedback_contract: None,
17965 observes_feedback: false,
17966}];
17967const LIST_VIEW_ITEM_EVENTS: &[EventDescriptor] = &[];
17968const LIST_VIEW_ITEM_SLOTS: &[SlotDescriptor] = &[];
17969const TREE_VIEW_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
17970 id: PropertyId::TreeViewSelectionMode,
17971 name: "SelectionMode",
17972 field: "selection_mode",
17973 value: "TreeViewSelectionMode",
17974 interface: "Microsoft.UI.Xaml.Controls.ITreeView",
17975 clearable: true,
17976 feedback: None,
17977 feedback_contract: None,
17978 observes_feedback: false,
17979}];
17980const TREE_VIEW_EVENTS: &[EventDescriptor] = &[EventDescriptor {
17981 id: EventId::TreeViewItemInvoked,
17982 name: "ItemInvoked",
17983 field: "on_item_invoked",
17984 payload: "Str",
17985 interface: "Microsoft.UI.Xaml.Controls.ITreeView",
17986}];
17987const TREE_VIEW_SLOTS: &[SlotDescriptor] = &[];
17988const GRID_VIEW_PROPERTIES: &[PropertyDescriptor] = &[
17989 PropertyDescriptor {
17990 id: PropertyId::GridViewSelectedIndex,
17991 name: "SelectedIndex",
17992 field: "selected_index",
17993 value: "SelectionIndex",
17994 interface: "Microsoft.UI.Xaml.Controls.Primitives.ISelector",
17995 clearable: true,
17996 feedback: Some("SelectionChanged"),
17997 feedback_contract: Some("synchronous_exact"),
17998 observes_feedback: true,
17999 },
18000 PropertyDescriptor {
18001 id: PropertyId::GridViewCanDragItems,
18002 name: "CanDragItems",
18003 field: "can_drag_items",
18004 value: "Bool",
18005 interface: "Microsoft.UI.Xaml.Controls.IListViewBase",
18006 clearable: true,
18007 feedback: None,
18008 feedback_contract: None,
18009 observes_feedback: false,
18010 },
18011 PropertyDescriptor {
18012 id: PropertyId::GridViewCanReorderItems,
18013 name: "CanReorderItems",
18014 field: "can_reorder_items",
18015 value: "Bool",
18016 interface: "Microsoft.UI.Xaml.Controls.IListViewBase",
18017 clearable: true,
18018 feedback: None,
18019 feedback_contract: None,
18020 observes_feedback: false,
18021 },
18022 PropertyDescriptor {
18023 id: PropertyId::GridViewAllowDrop,
18024 name: "AllowDrop",
18025 field: "allow_drop",
18026 value: "Bool",
18027 interface: "Microsoft.UI.Xaml.IUIElement",
18028 clearable: true,
18029 feedback: None,
18030 feedback_contract: None,
18031 observes_feedback: false,
18032 },
18033];
18034const GRID_VIEW_EVENTS: &[EventDescriptor] = &[
18035 EventDescriptor {
18036 id: EventId::GridViewDragItemsCompleted,
18037 name: "DragItemsCompleted",
18038 field: "on_reordered",
18039 payload: "StrList",
18040 interface: "Microsoft.UI.Xaml.Controls.IListViewBase",
18041 },
18042 EventDescriptor {
18043 id: EventId::GridViewSelectionChanged,
18044 name: "SelectionChanged",
18045 field: "on_selection_changed",
18046 payload: "SelectionIndex",
18047 interface: "Microsoft.UI.Xaml.Controls.Primitives.ISelector",
18048 },
18049];
18050const GRID_VIEW_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
18051 id: SlotId::GridViewItems,
18052 name: "Items",
18053 interface: "Microsoft.UI.Xaml.Controls.IItemsControl",
18054 target: "inspectable",
18055 collection: true,
18056}];
18057const GRID_VIEW_ITEM_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
18058 id: PropertyId::GridViewItemTag,
18059 name: "Tag",
18060 field: "tag",
18061 value: "Str",
18062 interface: "Microsoft.UI.Xaml.IFrameworkElement",
18063 clearable: true,
18064 feedback: None,
18065 feedback_contract: None,
18066 observes_feedback: false,
18067}];
18068const GRID_VIEW_ITEM_EVENTS: &[EventDescriptor] = &[];
18069const GRID_VIEW_ITEM_SLOTS: &[SlotDescriptor] = &[];
18070const RELATIVE_PANEL_PROPERTIES: &[PropertyDescriptor] = &[];
18071const RELATIVE_PANEL_EVENTS: &[EventDescriptor] = &[];
18072const RELATIVE_PANEL_SLOTS: &[SlotDescriptor] = &[];
18073const CANVAS_PROPERTIES: &[PropertyDescriptor] = &[];
18074const CANVAS_EVENTS: &[EventDescriptor] = &[];
18075const CANVAS_SLOTS: &[SlotDescriptor] = &[];
18076const RICH_EDIT_BOX_PROPERTIES: &[PropertyDescriptor] = &[
18077 PropertyDescriptor {
18078 id: PropertyId::RichEditBoxDocument,
18079 name: "Document",
18080 field: "text",
18081 value: "Str",
18082 interface: "Microsoft.UI.Xaml.Controls.IRichEditBox",
18083 clearable: true,
18084 feedback: Some("TextChanged"),
18085 feedback_contract: Some("synchronous_exact"),
18086 observes_feedback: true,
18087 },
18088 PropertyDescriptor {
18089 id: PropertyId::RichEditBoxPlaceholderText,
18090 name: "PlaceholderText",
18091 field: "placeholder_text",
18092 value: "Str",
18093 interface: "Microsoft.UI.Xaml.Controls.IRichEditBox",
18094 clearable: true,
18095 feedback: None,
18096 feedback_contract: None,
18097 observes_feedback: false,
18098 },
18099 PropertyDescriptor {
18100 id: PropertyId::RichEditBoxIsReadOnly,
18101 name: "IsReadOnly",
18102 field: "is_read_only",
18103 value: "Bool",
18104 interface: "Microsoft.UI.Xaml.Controls.IRichEditBox",
18105 clearable: true,
18106 feedback: None,
18107 feedback_contract: None,
18108 observes_feedback: false,
18109 },
18110 PropertyDescriptor {
18111 id: PropertyId::RichEditBoxIsEnabled,
18112 name: "IsEnabled",
18113 field: "is_enabled",
18114 value: "Bool",
18115 interface: "Microsoft.UI.Xaml.Controls.IControl",
18116 clearable: true,
18117 feedback: None,
18118 feedback_contract: None,
18119 observes_feedback: false,
18120 },
18121];
18122const RICH_EDIT_BOX_EVENTS: &[EventDescriptor] = &[EventDescriptor {
18123 id: EventId::RichEditBoxTextChanged,
18124 name: "TextChanged",
18125 field: "on_text_changed",
18126 payload: "Str",
18127 interface: "Microsoft.UI.Xaml.Controls.IRichEditBox",
18128}];
18129const RICH_EDIT_BOX_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
18130 id: SlotId::RichEditBoxHeader,
18131 name: "Header",
18132 interface: "Microsoft.UI.Xaml.Controls.IRichEditBox",
18133 target: "inspectable",
18134 collection: false,
18135}];
18136const RICH_TEXT_BLOCK_PROPERTIES: &[PropertyDescriptor] = &[
18137 PropertyDescriptor {
18138 id: PropertyId::RichTextBlockBlocks,
18139 name: "Blocks",
18140 field: "paragraphs",
18141 value: "RichText",
18142 interface: "Microsoft.UI.Xaml.Controls.IRichTextBlock",
18143 clearable: true,
18144 feedback: None,
18145 feedback_contract: None,
18146 observes_feedback: false,
18147 },
18148 PropertyDescriptor {
18149 id: PropertyId::RichTextBlockFontSize,
18150 name: "FontSize",
18151 field: "font_size",
18152 value: "F64",
18153 interface: "Microsoft.UI.Xaml.Controls.IRichTextBlock",
18154 clearable: true,
18155 feedback: None,
18156 feedback_contract: None,
18157 observes_feedback: false,
18158 },
18159 PropertyDescriptor {
18160 id: PropertyId::RichTextBlockIsTextSelectionEnabled,
18161 name: "IsTextSelectionEnabled",
18162 field: "is_text_selection_enabled",
18163 value: "Bool",
18164 interface: "Microsoft.UI.Xaml.Controls.IRichTextBlock",
18165 clearable: true,
18166 feedback: None,
18167 feedback_contract: None,
18168 observes_feedback: false,
18169 },
18170 PropertyDescriptor {
18171 id: PropertyId::RichTextBlockTextWrapping,
18172 name: "TextWrapping",
18173 field: "text_wrapping",
18174 value: "TextWrapping",
18175 interface: "Microsoft.UI.Xaml.Controls.IRichTextBlock",
18176 clearable: true,
18177 feedback: None,
18178 feedback_contract: None,
18179 observes_feedback: false,
18180 },
18181];
18182const RICH_TEXT_BLOCK_EVENTS: &[EventDescriptor] = &[];
18183const RICH_TEXT_BLOCK_SLOTS: &[SlotDescriptor] = &[];
18184const VIEWBOX_PROPERTIES: &[PropertyDescriptor] = &[PropertyDescriptor {
18185 id: PropertyId::ViewboxStretch,
18186 name: "Stretch",
18187 field: "stretch",
18188 value: "Stretch",
18189 interface: "Microsoft.UI.Xaml.Controls.IViewbox",
18190 clearable: true,
18191 feedback: None,
18192 feedback_contract: None,
18193 observes_feedback: false,
18194}];
18195const VIEWBOX_EVENTS: &[EventDescriptor] = &[];
18196const VIEWBOX_SLOTS: &[SlotDescriptor] = &[SlotDescriptor {
18197 id: SlotId::ViewboxChild,
18198 name: "Child",
18199 interface: "Microsoft.UI.Xaml.Controls.IViewbox",
18200 target: "ui_element",
18201 collection: false,
18202}];
18203const WEB_VIEW2_PROPERTIES: &[PropertyDescriptor] = &[];
18204const WEB_VIEW2_EVENTS: &[EventDescriptor] = &[];
18205const WEB_VIEW2_SLOTS: &[SlotDescriptor] = &[];
18206const SWAP_CHAIN_PANEL_PROPERTIES: &[PropertyDescriptor] = &[];
18207const SWAP_CHAIN_PANEL_EVENTS: &[EventDescriptor] = &[];
18208const SWAP_CHAIN_PANEL_SLOTS: &[SlotDescriptor] = &[];
18209pub const CONTROLS: &[ControlDescriptor] = &[
18210 ControlDescriptor {
18211 kind: MountedKind::TextBlock,
18212 name: "TextBlock",
18213 type_name: "Microsoft.UI.Xaml.Controls.TextBlock",
18214 role: ControlRole::Leaf,
18215 capabilities: &[Capability::Layout, Capability::TextStyle],
18216 properties: TEXT_BLOCK_PROPERTIES,
18217 events: TEXT_BLOCK_EVENTS,
18218 slots: TEXT_BLOCK_SLOTS,
18219 selection: None,
18220 controlled_collection: None,
18221 },
18222 ControlDescriptor {
18223 kind: MountedKind::Button,
18224 name: "Button",
18225 type_name: "Microsoft.UI.Xaml.Controls.Button",
18226 role: ControlRole::Content,
18227 capabilities: &[
18228 Capability::Layout,
18229 Capability::Enabled,
18230 Capability::Content,
18231 Capability::Focus,
18232 ],
18233 properties: BUTTON_PROPERTIES,
18234 events: BUTTON_EVENTS,
18235 slots: BUTTON_SLOTS,
18236 selection: None,
18237 controlled_collection: None,
18238 },
18239 ControlDescriptor {
18240 kind: MountedKind::HyperlinkButton,
18241 name: "HyperlinkButton",
18242 type_name: "Microsoft.UI.Xaml.Controls.HyperlinkButton",
18243 role: ControlRole::Content,
18244 capabilities: &[
18245 Capability::Layout,
18246 Capability::Enabled,
18247 Capability::Content,
18248 Capability::Focus,
18249 ],
18250 properties: HYPERLINK_BUTTON_PROPERTIES,
18251 events: HYPERLINK_BUTTON_EVENTS,
18252 slots: HYPERLINK_BUTTON_SLOTS,
18253 selection: None,
18254 controlled_collection: None,
18255 },
18256 ControlDescriptor {
18257 kind: MountedKind::RepeatButton,
18258 name: "RepeatButton",
18259 type_name: "Microsoft.UI.Xaml.Controls.Primitives.RepeatButton",
18260 role: ControlRole::Content,
18261 capabilities: &[Capability::Layout, Capability::Enabled, Capability::Content],
18262 properties: REPEAT_BUTTON_PROPERTIES,
18263 events: REPEAT_BUTTON_EVENTS,
18264 slots: REPEAT_BUTTON_SLOTS,
18265 selection: None,
18266 controlled_collection: None,
18267 },
18268 ControlDescriptor {
18269 kind: MountedKind::Border,
18270 name: "Border",
18271 type_name: "Microsoft.UI.Xaml.Controls.Border",
18272 role: ControlRole::Content,
18273 capabilities: &[Capability::Layout, Capability::Content],
18274 properties: BORDER_PROPERTIES,
18275 events: BORDER_EVENTS,
18276 slots: BORDER_SLOTS,
18277 selection: None,
18278 controlled_collection: None,
18279 },
18280 ControlDescriptor {
18281 kind: MountedKind::BreadcrumbBar,
18282 name: "BreadcrumbBar",
18283 type_name: "Microsoft.UI.Xaml.Controls.BreadcrumbBar",
18284 role: ControlRole::Leaf,
18285 capabilities: &[Capability::Layout],
18286 properties: BREADCRUMB_BAR_PROPERTIES,
18287 events: BREADCRUMB_BAR_EVENTS,
18288 slots: BREADCRUMB_BAR_SLOTS,
18289 selection: None,
18290 controlled_collection: None,
18291 },
18292 ControlDescriptor {
18293 kind: MountedKind::StackPanel,
18294 name: "StackPanel",
18295 type_name: "Microsoft.UI.Xaml.Controls.StackPanel",
18296 role: ControlRole::Children,
18297 capabilities: &[Capability::Layout, Capability::Children],
18298 properties: STACK_PANEL_PROPERTIES,
18299 events: STACK_PANEL_EVENTS,
18300 slots: STACK_PANEL_SLOTS,
18301 selection: None,
18302 controlled_collection: None,
18303 },
18304 ControlDescriptor {
18305 kind: MountedKind::VariableSizedWrapGrid,
18306 name: "VariableSizedWrapGrid",
18307 type_name: "Microsoft.UI.Xaml.Controls.VariableSizedWrapGrid",
18308 role: ControlRole::Children,
18309 capabilities: &[Capability::Layout, Capability::Children],
18310 properties: VARIABLE_SIZED_WRAP_GRID_PROPERTIES,
18311 events: VARIABLE_SIZED_WRAP_GRID_EVENTS,
18312 slots: VARIABLE_SIZED_WRAP_GRID_SLOTS,
18313 selection: None,
18314 controlled_collection: None,
18315 },
18316 ControlDescriptor {
18317 kind: MountedKind::Grid,
18318 name: "Grid",
18319 type_name: "Microsoft.UI.Xaml.Controls.Grid",
18320 role: ControlRole::Children,
18321 capabilities: &[
18322 Capability::Layout,
18323 Capability::Children,
18324 Capability::GridDefinitions,
18325 Capability::Reference,
18326 ],
18327 properties: GRID_PROPERTIES,
18328 events: GRID_EVENTS,
18329 slots: GRID_SLOTS,
18330 selection: None,
18331 controlled_collection: None,
18332 },
18333 ControlDescriptor {
18334 kind: MountedKind::TextBox,
18335 name: "TextBox",
18336 type_name: "Microsoft.UI.Xaml.Controls.TextBox",
18337 role: ControlRole::Slots,
18338 capabilities: &[
18339 Capability::Layout,
18340 Capability::Enabled,
18341 Capability::TextStyle,
18342 Capability::ControlledText,
18343 Capability::Focus,
18344 ],
18345 properties: TEXT_BOX_PROPERTIES,
18346 events: TEXT_BOX_EVENTS,
18347 slots: TEXT_BOX_SLOTS,
18348 selection: None,
18349 controlled_collection: None,
18350 },
18351 ControlDescriptor {
18352 kind: MountedKind::AutoSuggestBox,
18353 name: "AutoSuggestBox",
18354 type_name: "Microsoft.UI.Xaml.Controls.AutoSuggestBox",
18355 role: ControlRole::Slots,
18356 capabilities: &[Capability::Layout, Capability::Enabled, Capability::Focus],
18357 properties: AUTO_SUGGEST_BOX_PROPERTIES,
18358 events: AUTO_SUGGEST_BOX_EVENTS,
18359 slots: AUTO_SUGGEST_BOX_SLOTS,
18360 selection: None,
18361 controlled_collection: None,
18362 },
18363 ControlDescriptor {
18364 kind: MountedKind::PasswordBox,
18365 name: "PasswordBox",
18366 type_name: "Microsoft.UI.Xaml.Controls.PasswordBox",
18367 role: ControlRole::Slots,
18368 capabilities: &[Capability::Layout, Capability::Enabled, Capability::Focus],
18369 properties: PASSWORD_BOX_PROPERTIES,
18370 events: PASSWORD_BOX_EVENTS,
18371 slots: PASSWORD_BOX_SLOTS,
18372 selection: None,
18373 controlled_collection: None,
18374 },
18375 ControlDescriptor {
18376 kind: MountedKind::NumberBox,
18377 name: "NumberBox",
18378 type_name: "Microsoft.UI.Xaml.Controls.NumberBox",
18379 role: ControlRole::Slots,
18380 capabilities: &[Capability::Layout, Capability::Enabled, Capability::Focus],
18381 properties: NUMBER_BOX_PROPERTIES,
18382 events: NUMBER_BOX_EVENTS,
18383 slots: NUMBER_BOX_SLOTS,
18384 selection: None,
18385 controlled_collection: None,
18386 },
18387 ControlDescriptor {
18388 kind: MountedKind::Slider,
18389 name: "Slider",
18390 type_name: "Microsoft.UI.Xaml.Controls.Slider",
18391 role: ControlRole::Slots,
18392 capabilities: &[Capability::Layout, Capability::Enabled, Capability::Focus],
18393 properties: SLIDER_PROPERTIES,
18394 events: SLIDER_EVENTS,
18395 slots: SLIDER_SLOTS,
18396 selection: None,
18397 controlled_collection: None,
18398 },
18399 ControlDescriptor {
18400 kind: MountedKind::TitleBar,
18401 name: "TitleBar",
18402 type_name: "Microsoft.UI.Xaml.Controls.TitleBar",
18403 role: ControlRole::Slots,
18404 capabilities: &[Capability::Layout, Capability::WindowTitleBar],
18405 properties: TITLE_BAR_PROPERTIES,
18406 events: TITLE_BAR_EVENTS,
18407 slots: TITLE_BAR_SLOTS,
18408 selection: None,
18409 controlled_collection: None,
18410 },
18411 ControlDescriptor {
18412 kind: MountedKind::NavigationView,
18413 name: "NavigationView",
18414 type_name: "Microsoft.UI.Xaml.Controls.NavigationView",
18415 role: ControlRole::Slots,
18416 capabilities: &[Capability::Layout, Capability::Enabled],
18417 properties: NAVIGATION_VIEW_PROPERTIES,
18418 events: NAVIGATION_VIEW_EVENTS,
18419 slots: NAVIGATION_VIEW_SLOTS,
18420 selection: Some(SelectionDescriptor {
18421 slot: SlotId::NavigationViewMenuItems,
18422 item: MountedKind::NavigationViewItem,
18423 selected_property: PropertyId::NavigationViewItemIsSelected,
18424 event: EventId::NavigationViewSelectionChanged,
18425 payload_property: PropertyId::NavigationViewItemTag,
18426 }),
18427 controlled_collection: None,
18428 },
18429 ControlDescriptor {
18430 kind: MountedKind::NavigationViewItem,
18431 name: "NavigationViewItem",
18432 type_name: "Microsoft.UI.Xaml.Controls.NavigationViewItem",
18433 role: ControlRole::Slots,
18434 capabilities: &[Capability::Layout],
18435 properties: NAVIGATION_VIEW_ITEM_PROPERTIES,
18436 events: NAVIGATION_VIEW_ITEM_EVENTS,
18437 slots: NAVIGATION_VIEW_ITEM_SLOTS,
18438 selection: None,
18439 controlled_collection: None,
18440 },
18441 ControlDescriptor {
18442 kind: MountedKind::SplitView,
18443 name: "SplitView",
18444 type_name: "Microsoft.UI.Xaml.Controls.SplitView",
18445 role: ControlRole::Slots,
18446 capabilities: &[Capability::Layout],
18447 properties: SPLIT_VIEW_PROPERTIES,
18448 events: SPLIT_VIEW_EVENTS,
18449 slots: SPLIT_VIEW_SLOTS,
18450 selection: None,
18451 controlled_collection: None,
18452 },
18453 ControlDescriptor {
18454 kind: MountedKind::ProgressBar,
18455 name: "ProgressBar",
18456 type_name: "Microsoft.UI.Xaml.Controls.ProgressBar",
18457 role: ControlRole::Leaf,
18458 capabilities: &[Capability::Layout, Capability::Enabled],
18459 properties: PROGRESS_BAR_PROPERTIES,
18460 events: PROGRESS_BAR_EVENTS,
18461 slots: PROGRESS_BAR_SLOTS,
18462 selection: None,
18463 controlled_collection: None,
18464 },
18465 ControlDescriptor {
18466 kind: MountedKind::ToggleSwitch,
18467 name: "ToggleSwitch",
18468 type_name: "Microsoft.UI.Xaml.Controls.ToggleSwitch",
18469 role: ControlRole::Slots,
18470 capabilities: &[Capability::Layout, Capability::Enabled, Capability::Focus],
18471 properties: TOGGLE_SWITCH_PROPERTIES,
18472 events: TOGGLE_SWITCH_EVENTS,
18473 slots: TOGGLE_SWITCH_SLOTS,
18474 selection: None,
18475 controlled_collection: None,
18476 },
18477 ControlDescriptor {
18478 kind: MountedKind::CheckBox,
18479 name: "CheckBox",
18480 type_name: "Microsoft.UI.Xaml.Controls.CheckBox",
18481 role: ControlRole::Content,
18482 capabilities: &[
18483 Capability::Layout,
18484 Capability::Enabled,
18485 Capability::Content,
18486 Capability::Focus,
18487 ],
18488 properties: CHECK_BOX_PROPERTIES,
18489 events: CHECK_BOX_EVENTS,
18490 slots: CHECK_BOX_SLOTS,
18491 selection: None,
18492 controlled_collection: None,
18493 },
18494 ControlDescriptor {
18495 kind: MountedKind::ToggleButton,
18496 name: "ToggleButton",
18497 type_name: "Microsoft.UI.Xaml.Controls.Primitives.ToggleButton",
18498 role: ControlRole::Content,
18499 capabilities: &[
18500 Capability::Layout,
18501 Capability::Enabled,
18502 Capability::Content,
18503 Capability::Focus,
18504 ],
18505 properties: TOGGLE_BUTTON_PROPERTIES,
18506 events: TOGGLE_BUTTON_EVENTS,
18507 slots: TOGGLE_BUTTON_SLOTS,
18508 selection: None,
18509 controlled_collection: None,
18510 },
18511 ControlDescriptor {
18512 kind: MountedKind::RadioButton,
18513 name: "RadioButton",
18514 type_name: "Microsoft.UI.Xaml.Controls.RadioButton",
18515 role: ControlRole::Content,
18516 capabilities: &[
18517 Capability::Layout,
18518 Capability::Enabled,
18519 Capability::Content,
18520 Capability::Focus,
18521 ],
18522 properties: RADIO_BUTTON_PROPERTIES,
18523 events: RADIO_BUTTON_EVENTS,
18524 slots: RADIO_BUTTON_SLOTS,
18525 selection: None,
18526 controlled_collection: None,
18527 },
18528 ControlDescriptor {
18529 kind: MountedKind::RadioButtons,
18530 name: "RadioButtons",
18531 type_name: "Microsoft.UI.Xaml.Controls.RadioButtons",
18532 role: ControlRole::Slots,
18533 capabilities: &[Capability::Layout],
18534 properties: RADIO_BUTTONS_PROPERTIES,
18535 events: RADIO_BUTTONS_EVENTS,
18536 slots: RADIO_BUTTONS_SLOTS,
18537 selection: None,
18538 controlled_collection: None,
18539 },
18540 ControlDescriptor {
18541 kind: MountedKind::ItemsRepeater,
18542 name: "ItemsRepeater",
18543 type_name: "Microsoft.UI.Xaml.Controls.ItemsRepeater",
18544 role: ControlRole::Virtual,
18545 capabilities: &[Capability::Layout, Capability::Items],
18546 properties: ITEMS_REPEATER_PROPERTIES,
18547 events: ITEMS_REPEATER_EVENTS,
18548 slots: ITEMS_REPEATER_SLOTS,
18549 selection: None,
18550 controlled_collection: None,
18551 },
18552 ControlDescriptor {
18553 kind: MountedKind::InfoBadge,
18554 name: "InfoBadge",
18555 type_name: "Microsoft.UI.Xaml.Controls.InfoBadge",
18556 role: ControlRole::Leaf,
18557 capabilities: &[Capability::Layout],
18558 properties: INFO_BADGE_PROPERTIES,
18559 events: INFO_BADGE_EVENTS,
18560 slots: INFO_BADGE_SLOTS,
18561 selection: None,
18562 controlled_collection: None,
18563 },
18564 ControlDescriptor {
18565 kind: MountedKind::InfoBar,
18566 name: "InfoBar",
18567 type_name: "Microsoft.UI.Xaml.Controls.InfoBar",
18568 role: ControlRole::Leaf,
18569 capabilities: &[Capability::Layout],
18570 properties: INFO_BAR_PROPERTIES,
18571 events: INFO_BAR_EVENTS,
18572 slots: INFO_BAR_SLOTS,
18573 selection: None,
18574 controlled_collection: None,
18575 },
18576 ControlDescriptor {
18577 kind: MountedKind::PersonPicture,
18578 name: "PersonPicture",
18579 type_name: "Microsoft.UI.Xaml.Controls.PersonPicture",
18580 role: ControlRole::Leaf,
18581 capabilities: &[Capability::Layout],
18582 properties: PERSON_PICTURE_PROPERTIES,
18583 events: PERSON_PICTURE_EVENTS,
18584 slots: PERSON_PICTURE_SLOTS,
18585 selection: None,
18586 controlled_collection: None,
18587 },
18588 ControlDescriptor {
18589 kind: MountedKind::ScrollViewer,
18590 name: "ScrollViewer",
18591 type_name: "Microsoft.UI.Xaml.Controls.ScrollViewer",
18592 role: ControlRole::Content,
18593 capabilities: &[Capability::Layout, Capability::Content],
18594 properties: SCROLL_VIEWER_PROPERTIES,
18595 events: SCROLL_VIEWER_EVENTS,
18596 slots: SCROLL_VIEWER_SLOTS,
18597 selection: None,
18598 controlled_collection: None,
18599 },
18600 ControlDescriptor {
18601 kind: MountedKind::ScrollView,
18602 name: "ScrollView",
18603 type_name: "Microsoft.UI.Xaml.Controls.ScrollView",
18604 role: ControlRole::Content,
18605 capabilities: &[Capability::Layout, Capability::Content],
18606 properties: SCROLL_VIEW_PROPERTIES,
18607 events: SCROLL_VIEW_EVENTS,
18608 slots: SCROLL_VIEW_SLOTS,
18609 selection: None,
18610 controlled_collection: None,
18611 },
18612 ControlDescriptor {
18613 kind: MountedKind::Image,
18614 name: "Image",
18615 type_name: "Microsoft.UI.Xaml.Controls.Image",
18616 role: ControlRole::Leaf,
18617 capabilities: &[Capability::Layout, Capability::Reference],
18618 properties: IMAGE_PROPERTIES,
18619 events: IMAGE_EVENTS,
18620 slots: IMAGE_SLOTS,
18621 selection: None,
18622 controlled_collection: None,
18623 },
18624 ControlDescriptor {
18625 kind: MountedKind::ProgressRing,
18626 name: "ProgressRing",
18627 type_name: "Microsoft.UI.Xaml.Controls.ProgressRing",
18628 role: ControlRole::Leaf,
18629 capabilities: &[Capability::Layout, Capability::Enabled],
18630 properties: PROGRESS_RING_PROPERTIES,
18631 events: PROGRESS_RING_EVENTS,
18632 slots: PROGRESS_RING_SLOTS,
18633 selection: None,
18634 controlled_collection: None,
18635 },
18636 ControlDescriptor {
18637 kind: MountedKind::ListBox,
18638 name: "ListBox",
18639 type_name: "Microsoft.UI.Xaml.Controls.ListBox",
18640 role: ControlRole::Slots,
18641 capabilities: &[Capability::Layout, Capability::Enabled],
18642 properties: LIST_BOX_PROPERTIES,
18643 events: LIST_BOX_EVENTS,
18644 slots: LIST_BOX_SLOTS,
18645 selection: Some(SelectionDescriptor {
18646 slot: SlotId::ListBoxItems,
18647 item: MountedKind::ListBoxItem,
18648 selected_property: PropertyId::ListBoxItemIsSelected,
18649 event: EventId::ListBoxSelectionChanged,
18650 payload_property: PropertyId::ListBoxItemTag,
18651 }),
18652 controlled_collection: None,
18653 },
18654 ControlDescriptor {
18655 kind: MountedKind::Rectangle,
18656 name: "Rectangle",
18657 type_name: "Microsoft.UI.Xaml.Shapes.Rectangle",
18658 role: ControlRole::Leaf,
18659 capabilities: &[Capability::Layout],
18660 properties: RECTANGLE_PROPERTIES,
18661 events: RECTANGLE_EVENTS,
18662 slots: RECTANGLE_SLOTS,
18663 selection: None,
18664 controlled_collection: None,
18665 },
18666 ControlDescriptor {
18667 kind: MountedKind::Ellipse,
18668 name: "Ellipse",
18669 type_name: "Microsoft.UI.Xaml.Shapes.Ellipse",
18670 role: ControlRole::Leaf,
18671 capabilities: &[Capability::Layout],
18672 properties: ELLIPSE_PROPERTIES,
18673 events: ELLIPSE_EVENTS,
18674 slots: ELLIPSE_SLOTS,
18675 selection: None,
18676 controlled_collection: None,
18677 },
18678 ControlDescriptor {
18679 kind: MountedKind::Line,
18680 name: "Line",
18681 type_name: "Microsoft.UI.Xaml.Shapes.Line",
18682 role: ControlRole::Leaf,
18683 capabilities: &[Capability::Layout],
18684 properties: LINE_PROPERTIES,
18685 events: LINE_EVENTS,
18686 slots: LINE_SLOTS,
18687 selection: None,
18688 controlled_collection: None,
18689 },
18690 ControlDescriptor {
18691 kind: MountedKind::SymbolIcon,
18692 name: "SymbolIcon",
18693 type_name: "Microsoft.UI.Xaml.Controls.SymbolIcon",
18694 role: ControlRole::Leaf,
18695 capabilities: &[Capability::Layout],
18696 properties: SYMBOL_ICON_PROPERTIES,
18697 events: SYMBOL_ICON_EVENTS,
18698 slots: SYMBOL_ICON_SLOTS,
18699 selection: None,
18700 controlled_collection: None,
18701 },
18702 ControlDescriptor {
18703 kind: MountedKind::ImageIcon,
18704 name: "ImageIcon",
18705 type_name: "Microsoft.UI.Xaml.Controls.ImageIcon",
18706 role: ControlRole::Leaf,
18707 capabilities: &[Capability::Layout],
18708 properties: IMAGE_ICON_PROPERTIES,
18709 events: IMAGE_ICON_EVENTS,
18710 slots: IMAGE_ICON_SLOTS,
18711 selection: None,
18712 controlled_collection: None,
18713 },
18714 ControlDescriptor {
18715 kind: MountedKind::FontIcon,
18716 name: "FontIcon",
18717 type_name: "Microsoft.UI.Xaml.Controls.FontIcon",
18718 role: ControlRole::Leaf,
18719 capabilities: &[Capability::Layout],
18720 properties: FONT_ICON_PROPERTIES,
18721 events: FONT_ICON_EVENTS,
18722 slots: FONT_ICON_SLOTS,
18723 selection: None,
18724 controlled_collection: None,
18725 },
18726 ControlDescriptor {
18727 kind: MountedKind::BitmapIcon,
18728 name: "BitmapIcon",
18729 type_name: "Microsoft.UI.Xaml.Controls.BitmapIcon",
18730 role: ControlRole::Leaf,
18731 capabilities: &[Capability::Layout],
18732 properties: BITMAP_ICON_PROPERTIES,
18733 events: BITMAP_ICON_EVENTS,
18734 slots: BITMAP_ICON_SLOTS,
18735 selection: None,
18736 controlled_collection: None,
18737 },
18738 ControlDescriptor {
18739 kind: MountedKind::PathIcon,
18740 name: "PathIcon",
18741 type_name: "Microsoft.UI.Xaml.Controls.PathIcon",
18742 role: ControlRole::Leaf,
18743 capabilities: &[Capability::Layout],
18744 properties: PATH_ICON_PROPERTIES,
18745 events: PATH_ICON_EVENTS,
18746 slots: PATH_ICON_SLOTS,
18747 selection: None,
18748 controlled_collection: None,
18749 },
18750 ControlDescriptor {
18751 kind: MountedKind::ListBoxItem,
18752 name: "ListBoxItem",
18753 type_name: "Microsoft.UI.Xaml.Controls.ListBoxItem",
18754 role: ControlRole::Content,
18755 capabilities: &[Capability::Layout, Capability::Content],
18756 properties: LIST_BOX_ITEM_PROPERTIES,
18757 events: LIST_BOX_ITEM_EVENTS,
18758 slots: LIST_BOX_ITEM_SLOTS,
18759 selection: None,
18760 controlled_collection: None,
18761 },
18762 ControlDescriptor {
18763 kind: MountedKind::RatingControl,
18764 name: "RatingControl",
18765 type_name: "Microsoft.UI.Xaml.Controls.RatingControl",
18766 role: ControlRole::Leaf,
18767 capabilities: &[Capability::Layout, Capability::Focus],
18768 properties: RATING_CONTROL_PROPERTIES,
18769 events: RATING_CONTROL_EVENTS,
18770 slots: RATING_CONTROL_SLOTS,
18771 selection: None,
18772 controlled_collection: None,
18773 },
18774 ControlDescriptor {
18775 kind: MountedKind::Expander,
18776 name: "Expander",
18777 type_name: "Microsoft.UI.Xaml.Controls.Expander",
18778 role: ControlRole::Slots,
18779 capabilities: &[Capability::Layout],
18780 properties: EXPANDER_PROPERTIES,
18781 events: EXPANDER_EVENTS,
18782 slots: EXPANDER_SLOTS,
18783 selection: None,
18784 controlled_collection: None,
18785 },
18786 ControlDescriptor {
18787 kind: MountedKind::ComboBox,
18788 name: "ComboBox",
18789 type_name: "Microsoft.UI.Xaml.Controls.ComboBox",
18790 role: ControlRole::Slots,
18791 capabilities: &[Capability::Layout, Capability::Enabled, Capability::Focus],
18792 properties: COMBO_BOX_PROPERTIES,
18793 events: COMBO_BOX_EVENTS,
18794 slots: COMBO_BOX_SLOTS,
18795 selection: None,
18796 controlled_collection: None,
18797 },
18798 ControlDescriptor {
18799 kind: MountedKind::Pivot,
18800 name: "Pivot",
18801 type_name: "Microsoft.UI.Xaml.Controls.Pivot",
18802 role: ControlRole::Slots,
18803 capabilities: &[Capability::Layout],
18804 properties: PIVOT_PROPERTIES,
18805 events: PIVOT_EVENTS,
18806 slots: PIVOT_SLOTS,
18807 selection: None,
18808 controlled_collection: Some(ControlledCollectionDescriptor {
18809 slot: SlotId::PivotItems,
18810 property: PropertyId::PivotSelectedIndex,
18811 event: EventId::PivotSelectionChanged,
18812 }),
18813 },
18814 ControlDescriptor {
18815 kind: MountedKind::PivotItem,
18816 name: "PivotItem",
18817 type_name: "Microsoft.UI.Xaml.Controls.PivotItem",
18818 role: ControlRole::Content,
18819 capabilities: &[Capability::Layout, Capability::Content],
18820 properties: PIVOT_ITEM_PROPERTIES,
18821 events: PIVOT_ITEM_EVENTS,
18822 slots: PIVOT_ITEM_SLOTS,
18823 selection: None,
18824 controlled_collection: None,
18825 },
18826 ControlDescriptor {
18827 kind: MountedKind::FlipView,
18828 name: "FlipView",
18829 type_name: "Microsoft.UI.Xaml.Controls.FlipView",
18830 role: ControlRole::Slots,
18831 capabilities: &[Capability::Layout],
18832 properties: FLIP_VIEW_PROPERTIES,
18833 events: FLIP_VIEW_EVENTS,
18834 slots: FLIP_VIEW_SLOTS,
18835 selection: None,
18836 controlled_collection: Some(ControlledCollectionDescriptor {
18837 slot: SlotId::FlipViewItems,
18838 property: PropertyId::FlipViewSelectedIndex,
18839 event: EventId::FlipViewSelectionChanged,
18840 }),
18841 },
18842 ControlDescriptor {
18843 kind: MountedKind::SelectorBar,
18844 name: "SelectorBar",
18845 type_name: "Microsoft.UI.Xaml.Controls.SelectorBar",
18846 role: ControlRole::Slots,
18847 capabilities: &[Capability::Layout],
18848 properties: SELECTOR_BAR_PROPERTIES,
18849 events: SELECTOR_BAR_EVENTS,
18850 slots: SELECTOR_BAR_SLOTS,
18851 selection: Some(SelectionDescriptor {
18852 slot: SlotId::SelectorBarItems,
18853 item: MountedKind::SelectorBarItem,
18854 selected_property: PropertyId::SelectorBarItemIsSelected,
18855 event: EventId::SelectorBarSelectionChanged,
18856 payload_property: PropertyId::SelectorBarItemText,
18857 }),
18858 controlled_collection: None,
18859 },
18860 ControlDescriptor {
18861 kind: MountedKind::SelectorBarItem,
18862 name: "SelectorBarItem",
18863 type_name: "Microsoft.UI.Xaml.Controls.SelectorBarItem",
18864 role: ControlRole::Slots,
18865 capabilities: &[Capability::Layout],
18866 properties: SELECTOR_BAR_ITEM_PROPERTIES,
18867 events: SELECTOR_BAR_ITEM_EVENTS,
18868 slots: SELECTOR_BAR_ITEM_SLOTS,
18869 selection: None,
18870 controlled_collection: None,
18871 },
18872 ControlDescriptor {
18873 kind: MountedKind::TabView,
18874 name: "TabView",
18875 type_name: "Microsoft.UI.Xaml.Controls.TabView",
18876 role: ControlRole::Slots,
18877 capabilities: &[Capability::Layout],
18878 properties: TAB_VIEW_PROPERTIES,
18879 events: TAB_VIEW_EVENTS,
18880 slots: TAB_VIEW_SLOTS,
18881 selection: None,
18882 controlled_collection: Some(ControlledCollectionDescriptor {
18883 slot: SlotId::TabViewTabItems,
18884 property: PropertyId::TabViewSelectedIndex,
18885 event: EventId::TabViewSelectionChanged,
18886 }),
18887 },
18888 ControlDescriptor {
18889 kind: MountedKind::TabViewItem,
18890 name: "TabViewItem",
18891 type_name: "Microsoft.UI.Xaml.Controls.TabViewItem",
18892 role: ControlRole::Content,
18893 capabilities: &[Capability::Layout, Capability::Content],
18894 properties: TAB_VIEW_ITEM_PROPERTIES,
18895 events: TAB_VIEW_ITEM_EVENTS,
18896 slots: TAB_VIEW_ITEM_SLOTS,
18897 selection: None,
18898 controlled_collection: None,
18899 },
18900 ControlDescriptor {
18901 kind: MountedKind::TeachingTip,
18902 name: "TeachingTip",
18903 type_name: "Microsoft.UI.Xaml.Controls.TeachingTip",
18904 role: ControlRole::Leaf,
18905 capabilities: &[Capability::Layout],
18906 properties: TEACHING_TIP_PROPERTIES,
18907 events: TEACHING_TIP_EVENTS,
18908 slots: TEACHING_TIP_SLOTS,
18909 selection: None,
18910 controlled_collection: None,
18911 },
18912 ControlDescriptor {
18913 kind: MountedKind::DropDownButton,
18914 name: "DropDownButton",
18915 type_name: "Microsoft.UI.Xaml.Controls.DropDownButton",
18916 role: ControlRole::Content,
18917 capabilities: &[Capability::Layout, Capability::Content, Capability::Enabled],
18918 properties: DROP_DOWN_BUTTON_PROPERTIES,
18919 events: DROP_DOWN_BUTTON_EVENTS,
18920 slots: DROP_DOWN_BUTTON_SLOTS,
18921 selection: None,
18922 controlled_collection: None,
18923 },
18924 ControlDescriptor {
18925 kind: MountedKind::CommandBar,
18926 name: "CommandBar",
18927 type_name: "Microsoft.UI.Xaml.Controls.CommandBar",
18928 role: ControlRole::Slots,
18929 capabilities: &[Capability::Layout],
18930 properties: COMMAND_BAR_PROPERTIES,
18931 events: COMMAND_BAR_EVENTS,
18932 slots: COMMAND_BAR_SLOTS,
18933 selection: None,
18934 controlled_collection: None,
18935 },
18936 ControlDescriptor {
18937 kind: MountedKind::AppBarButton,
18938 name: "AppBarButton",
18939 type_name: "Microsoft.UI.Xaml.Controls.AppBarButton",
18940 role: ControlRole::Slots,
18941 capabilities: &[Capability::Layout, Capability::Enabled],
18942 properties: APP_BAR_BUTTON_PROPERTIES,
18943 events: APP_BAR_BUTTON_EVENTS,
18944 slots: APP_BAR_BUTTON_SLOTS,
18945 selection: None,
18946 controlled_collection: None,
18947 },
18948 ControlDescriptor {
18949 kind: MountedKind::AppBarSeparator,
18950 name: "AppBarSeparator",
18951 type_name: "Microsoft.UI.Xaml.Controls.AppBarSeparator",
18952 role: ControlRole::Leaf,
18953 capabilities: &[Capability::Layout],
18954 properties: APP_BAR_SEPARATOR_PROPERTIES,
18955 events: APP_BAR_SEPARATOR_EVENTS,
18956 slots: APP_BAR_SEPARATOR_SLOTS,
18957 selection: None,
18958 controlled_collection: None,
18959 },
18960 ControlDescriptor {
18961 kind: MountedKind::MenuBar,
18962 name: "MenuBar",
18963 type_name: "Microsoft.UI.Xaml.Controls.MenuBar",
18964 role: ControlRole::Slots,
18965 capabilities: &[Capability::Layout],
18966 properties: MENU_BAR_PROPERTIES,
18967 events: MENU_BAR_EVENTS,
18968 slots: MENU_BAR_SLOTS,
18969 selection: None,
18970 controlled_collection: None,
18971 },
18972 ControlDescriptor {
18973 kind: MountedKind::MenuBarItem,
18974 name: "MenuBarItem",
18975 type_name: "Microsoft.UI.Xaml.Controls.MenuBarItem",
18976 role: ControlRole::Leaf,
18977 capabilities: &[Capability::Layout],
18978 properties: MENU_BAR_ITEM_PROPERTIES,
18979 events: MENU_BAR_ITEM_EVENTS,
18980 slots: MENU_BAR_ITEM_SLOTS,
18981 selection: None,
18982 controlled_collection: None,
18983 },
18984 ControlDescriptor {
18985 kind: MountedKind::SplitButton,
18986 name: "SplitButton",
18987 type_name: "Microsoft.UI.Xaml.Controls.SplitButton",
18988 role: ControlRole::Content,
18989 capabilities: &[Capability::Layout, Capability::Content, Capability::Enabled],
18990 properties: SPLIT_BUTTON_PROPERTIES,
18991 events: SPLIT_BUTTON_EVENTS,
18992 slots: SPLIT_BUTTON_SLOTS,
18993 selection: None,
18994 controlled_collection: None,
18995 },
18996 ControlDescriptor {
18997 kind: MountedKind::ColorPicker,
18998 name: "ColorPicker",
18999 type_name: "Microsoft.UI.Xaml.Controls.ColorPicker",
19000 role: ControlRole::Leaf,
19001 capabilities: &[Capability::Layout, Capability::Enabled],
19002 properties: COLOR_PICKER_PROPERTIES,
19003 events: COLOR_PICKER_EVENTS,
19004 slots: COLOR_PICKER_SLOTS,
19005 selection: None,
19006 controlled_collection: None,
19007 },
19008 ControlDescriptor {
19009 kind: MountedKind::DatePicker,
19010 name: "DatePicker",
19011 type_name: "Microsoft.UI.Xaml.Controls.DatePicker",
19012 role: ControlRole::Slots,
19013 capabilities: &[Capability::Layout, Capability::Enabled],
19014 properties: DATE_PICKER_PROPERTIES,
19015 events: DATE_PICKER_EVENTS,
19016 slots: DATE_PICKER_SLOTS,
19017 selection: None,
19018 controlled_collection: None,
19019 },
19020 ControlDescriptor {
19021 kind: MountedKind::TimePicker,
19022 name: "TimePicker",
19023 type_name: "Microsoft.UI.Xaml.Controls.TimePicker",
19024 role: ControlRole::Slots,
19025 capabilities: &[Capability::Layout, Capability::Enabled],
19026 properties: TIME_PICKER_PROPERTIES,
19027 events: TIME_PICKER_EVENTS,
19028 slots: TIME_PICKER_SLOTS,
19029 selection: None,
19030 controlled_collection: None,
19031 },
19032 ControlDescriptor {
19033 kind: MountedKind::CalendarDatePicker,
19034 name: "CalendarDatePicker",
19035 type_name: "Microsoft.UI.Xaml.Controls.CalendarDatePicker",
19036 role: ControlRole::Slots,
19037 capabilities: &[Capability::Layout, Capability::Enabled],
19038 properties: CALENDAR_DATE_PICKER_PROPERTIES,
19039 events: CALENDAR_DATE_PICKER_EVENTS,
19040 slots: CALENDAR_DATE_PICKER_SLOTS,
19041 selection: None,
19042 controlled_collection: None,
19043 },
19044 ControlDescriptor {
19045 kind: MountedKind::ToolTip,
19046 name: "ToolTip",
19047 type_name: "Microsoft.UI.Xaml.Controls.ToolTip",
19048 role: ControlRole::Content,
19049 capabilities: &[Capability::Content],
19050 properties: TOOL_TIP_PROPERTIES,
19051 events: TOOL_TIP_EVENTS,
19052 slots: TOOL_TIP_SLOTS,
19053 selection: None,
19054 controlled_collection: None,
19055 },
19056 ControlDescriptor {
19057 kind: MountedKind::ContentDialog,
19058 name: "ContentDialog",
19059 type_name: "Microsoft.UI.Xaml.Controls.ContentDialog",
19060 role: ControlRole::Content,
19061 capabilities: &[Capability::Content],
19062 properties: CONTENT_DIALOG_PROPERTIES,
19063 events: CONTENT_DIALOG_EVENTS,
19064 slots: CONTENT_DIALOG_SLOTS,
19065 selection: None,
19066 controlled_collection: None,
19067 },
19068 ControlDescriptor {
19069 kind: MountedKind::CalendarView,
19070 name: "CalendarView",
19071 type_name: "Microsoft.UI.Xaml.Controls.CalendarView",
19072 role: ControlRole::Leaf,
19073 capabilities: &[Capability::Layout, Capability::Enabled],
19074 properties: CALENDAR_VIEW_PROPERTIES,
19075 events: CALENDAR_VIEW_EVENTS,
19076 slots: CALENDAR_VIEW_SLOTS,
19077 selection: None,
19078 controlled_collection: None,
19079 },
19080 ControlDescriptor {
19081 kind: MountedKind::ListView,
19082 name: "ListView",
19083 type_name: "Microsoft.UI.Xaml.Controls.ListView",
19084 role: ControlRole::Slots,
19085 capabilities: &[Capability::Layout, Capability::Enabled],
19086 properties: LIST_VIEW_PROPERTIES,
19087 events: LIST_VIEW_EVENTS,
19088 slots: LIST_VIEW_SLOTS,
19089 selection: None,
19090 controlled_collection: Some(ControlledCollectionDescriptor {
19091 slot: SlotId::ListViewItems,
19092 property: PropertyId::ListViewSelectedIndex,
19093 event: EventId::ListViewSelectionChanged,
19094 }),
19095 },
19096 ControlDescriptor {
19097 kind: MountedKind::ListViewItem,
19098 name: "ListViewItem",
19099 type_name: "Microsoft.UI.Xaml.Controls.ListViewItem",
19100 role: ControlRole::Content,
19101 capabilities: &[Capability::Layout, Capability::Content, Capability::Enabled],
19102 properties: LIST_VIEW_ITEM_PROPERTIES,
19103 events: LIST_VIEW_ITEM_EVENTS,
19104 slots: LIST_VIEW_ITEM_SLOTS,
19105 selection: None,
19106 controlled_collection: None,
19107 },
19108 ControlDescriptor {
19109 kind: MountedKind::TreeView,
19110 name: "TreeView",
19111 type_name: "Microsoft.UI.Xaml.Controls.TreeView",
19112 role: ControlRole::Leaf,
19113 capabilities: &[Capability::Layout, Capability::Enabled],
19114 properties: TREE_VIEW_PROPERTIES,
19115 events: TREE_VIEW_EVENTS,
19116 slots: TREE_VIEW_SLOTS,
19117 selection: None,
19118 controlled_collection: None,
19119 },
19120 ControlDescriptor {
19121 kind: MountedKind::GridView,
19122 name: "GridView",
19123 type_name: "Microsoft.UI.Xaml.Controls.GridView",
19124 role: ControlRole::Slots,
19125 capabilities: &[Capability::Layout, Capability::Enabled],
19126 properties: GRID_VIEW_PROPERTIES,
19127 events: GRID_VIEW_EVENTS,
19128 slots: GRID_VIEW_SLOTS,
19129 selection: None,
19130 controlled_collection: Some(ControlledCollectionDescriptor {
19131 slot: SlotId::GridViewItems,
19132 property: PropertyId::GridViewSelectedIndex,
19133 event: EventId::GridViewSelectionChanged,
19134 }),
19135 },
19136 ControlDescriptor {
19137 kind: MountedKind::GridViewItem,
19138 name: "GridViewItem",
19139 type_name: "Microsoft.UI.Xaml.Controls.GridViewItem",
19140 role: ControlRole::Content,
19141 capabilities: &[Capability::Layout, Capability::Content, Capability::Enabled],
19142 properties: GRID_VIEW_ITEM_PROPERTIES,
19143 events: GRID_VIEW_ITEM_EVENTS,
19144 slots: GRID_VIEW_ITEM_SLOTS,
19145 selection: None,
19146 controlled_collection: None,
19147 },
19148 ControlDescriptor {
19149 kind: MountedKind::RelativePanel,
19150 name: "RelativePanel",
19151 type_name: "Microsoft.UI.Xaml.Controls.RelativePanel",
19152 role: ControlRole::Children,
19153 capabilities: &[Capability::Layout, Capability::Children],
19154 properties: RELATIVE_PANEL_PROPERTIES,
19155 events: RELATIVE_PANEL_EVENTS,
19156 slots: RELATIVE_PANEL_SLOTS,
19157 selection: None,
19158 controlled_collection: None,
19159 },
19160 ControlDescriptor {
19161 kind: MountedKind::Canvas,
19162 name: "Canvas",
19163 type_name: "Microsoft.UI.Xaml.Controls.Canvas",
19164 role: ControlRole::Children,
19165 capabilities: &[Capability::Layout, Capability::Children],
19166 properties: CANVAS_PROPERTIES,
19167 events: CANVAS_EVENTS,
19168 slots: CANVAS_SLOTS,
19169 selection: None,
19170 controlled_collection: None,
19171 },
19172 ControlDescriptor {
19173 kind: MountedKind::RichEditBox,
19174 name: "RichEditBox",
19175 type_name: "Microsoft.UI.Xaml.Controls.RichEditBox",
19176 role: ControlRole::Slots,
19177 capabilities: &[
19178 Capability::Layout,
19179 Capability::Enabled,
19180 Capability::ControlledText,
19181 Capability::Focus,
19182 ],
19183 properties: RICH_EDIT_BOX_PROPERTIES,
19184 events: RICH_EDIT_BOX_EVENTS,
19185 slots: RICH_EDIT_BOX_SLOTS,
19186 selection: None,
19187 controlled_collection: None,
19188 },
19189 ControlDescriptor {
19190 kind: MountedKind::RichTextBlock,
19191 name: "RichTextBlock",
19192 type_name: "Microsoft.UI.Xaml.Controls.RichTextBlock",
19193 role: ControlRole::Leaf,
19194 capabilities: &[Capability::Layout, Capability::TextStyle],
19195 properties: RICH_TEXT_BLOCK_PROPERTIES,
19196 events: RICH_TEXT_BLOCK_EVENTS,
19197 slots: RICH_TEXT_BLOCK_SLOTS,
19198 selection: None,
19199 controlled_collection: None,
19200 },
19201 ControlDescriptor {
19202 kind: MountedKind::Viewbox,
19203 name: "Viewbox",
19204 type_name: "Microsoft.UI.Xaml.Controls.Viewbox",
19205 role: ControlRole::Slots,
19206 capabilities: &[Capability::Layout],
19207 properties: VIEWBOX_PROPERTIES,
19208 events: VIEWBOX_EVENTS,
19209 slots: VIEWBOX_SLOTS,
19210 selection: None,
19211 controlled_collection: None,
19212 },
19213 ControlDescriptor {
19214 kind: MountedKind::WebView2,
19215 name: "WebView2",
19216 type_name: "Microsoft.UI.Xaml.Controls.WebView2",
19217 role: ControlRole::Leaf,
19218 capabilities: &[Capability::Layout, Capability::Reference],
19219 properties: WEB_VIEW2_PROPERTIES,
19220 events: WEB_VIEW2_EVENTS,
19221 slots: WEB_VIEW2_SLOTS,
19222 selection: None,
19223 controlled_collection: None,
19224 },
19225 ControlDescriptor {
19226 kind: MountedKind::SwapChainPanel,
19227 name: "SwapChainPanel",
19228 type_name: "Microsoft.UI.Xaml.Controls.SwapChainPanel",
19229 role: ControlRole::Leaf,
19230 capabilities: &[Capability::Layout, Capability::Reference],
19231 properties: SWAP_CHAIN_PANEL_PROPERTIES,
19232 events: SWAP_CHAIN_PANEL_EVENTS,
19233 slots: SWAP_CHAIN_PANEL_SLOTS,
19234 selection: None,
19235 controlled_collection: None,
19236 },
19237];
19238pub fn selection_for_event(event: EventId) -> Option<SelectionDescriptor> {
19239 CONTROLS.iter().find_map(|control| {
19240 control
19241 .selection
19242 .filter(|selection| selection.event == event)
19243 })
19244}
19245pub fn selection_for_slot(slot: SlotId) -> Option<SelectionDescriptor> {
19246 CONTROLS
19247 .iter()
19248 .find_map(|control| control.selection.filter(|selection| selection.slot == slot))
19249}
19250pub fn selection_for_item_property(
19251 property: PropertyId,
19252 slot: SlotId,
19253) -> Option<SelectionDescriptor> {
19254 CONTROLS.iter().find_map(|control| {
19255 control
19256 .selection
19257 .filter(|selection| selection.selected_property == property && selection.slot == slot)
19258 })
19259}
19260pub fn controlled_collection_for_slot(slot: SlotId) -> Option<ControlledCollectionDescriptor> {
19261 CONTROLS.iter().find_map(|control| {
19262 control
19263 .controlled_collection
19264 .filter(|collection| collection.slot == slot)
19265 })
19266}
19267pub fn controlled_collection_for_property(
19268 property: PropertyId,
19269) -> Option<ControlledCollectionDescriptor> {
19270 CONTROLS.iter().find_map(|control| {
19271 control
19272 .controlled_collection
19273 .filter(|collection| collection.property == property)
19274 })
19275}
19276const _: () = {
19277 let _: Option<PropertyValue> = None;
19278 let mut control_index = 0;
19279 while control_index < CONTROLS.len() {
19280 let control = &CONTROLS[control_index];
19281 let _ = (
19282 control.name,
19283 control.type_name,
19284 control.kind,
19285 control.role,
19286 control.capabilities,
19287 control.slots,
19288 control.controlled_collection,
19289 );
19290 let mut property_index = 0;
19291 while property_index < control.properties.len() {
19292 let property = &control.properties[property_index];
19293 let _ = (
19294 property.name,
19295 property.id,
19296 property.field,
19297 property.value,
19298 property.interface,
19299 property.clearable,
19300 property.feedback,
19301 property.feedback_contract,
19302 property.observes_feedback,
19303 );
19304 property_index += 1;
19305 }
19306 let mut event_index = 0;
19307 while event_index < control.events.len() {
19308 let event = &control.events[event_index];
19309 let _ = (
19310 event.id,
19311 event.name,
19312 event.field,
19313 event.payload,
19314 event.interface,
19315 );
19316 event_index += 1;
19317 }
19318 let mut slot_index = 0;
19319 while slot_index < control.slots.len() {
19320 let slot = &control.slots[slot_index];
19321 let _ = (slot.id, slot.name, slot.interface, slot.target);
19322 slot_index += 1;
19323 }
19324 control_index += 1;
19325 }
19326};