简体   繁体   中英

Setting properties of controls as values

Is it right to set properties in XAML as values bymyself? Without bindings or other dependencies. Is WPF smart enough to make the application crossplatform? Will my application seem on another computers like on my computer, even with such strings as Margin = "0,10,10,0" or Height/Width = 566, for example?

  1. Is it right to set properties in XAML as values by myself?

Its not MVVM , and some would say you are circumventing the bind-ability of WPF , but it is valid, and no-one can old it against you (much)

  1. Without bindings or other dependencies. Is WPF smart enough to make the application cross-platform?

If you were able to make WPF cross-platform (and i'm not really sure how you would do that (yet)), all else aside it is not WPF that would be smart, additionally your bindings would have no baring or relevance to this question.

  1. Will my application seem on another computers like on my computer, even with such strings as Margin = "0,10,10,0" or Height/Width = 566, for example?

Once again setting Xaml properties from Code-Behind has the baring or relevance on how other computers display the Xaml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM