Questions tagged [xbind]

{x:Bind} is a markup extension used in XAML and was released with Windows Universal Apps. The {x:Bind} binding is fundermentally different to the {Binding} binding as it is done at XAML load time and thus provides performance and diagnostic improvements over {Binding} which is done at runtime using reflection.

The {x:Bind} markup extension added for Windows 10, is an alternative to {Binding}. {x:Bind} currently lacks some of the features of {Binding}, but it runs in less time and less memory than {Binding} and supports a better debugging experience.

At XAML load time, {x:Bind} is converted into what you can think of as a binding object, and this object gets a value from a property on a data source. As with {Binding} the bound object can optionally be configured to observe changes in the value of the data source property and refresh itself based on those changes and it can also, optionally, be configured to push changes in its own value back to the source property.

The binding objects created by {x:Bind} and {Binding} are largely functionally equivalent, but {x:Bind} executes special-purpose code, which it generates at compile-time, and {Binding} uses general-purpose runtime object inspection. Consequently, {x:Bind} bindings (often referred-to as compiled bindings) have great performance, provide compile-time validation of your binding expressions, and support debugging by enabling you to set breakpoints in the code files that are generated as the partial class for your page.

Further detail can be found here

72 questions
10
votes
2 answers

Alternative to ElementName in x:Bind with DataTemplates

When using traditional {Binding} syntax you could specify element name to point to a specific control on the page, and be able to access its properties. For example if the page is named page you could do: {Binding ElementName=Page, Path=Name} With…
Robert MacLean
  • 38,975
  • 25
  • 98
  • 152
10
votes
3 answers

UWP XAML x:Bind inherited interfaces are not recognized

When using x:Bind in a UWP XAML application consider the following: interface IBaseInterface { string A { get; set; } } interface ISubInterface : IBaseInterface { string B { get; set; } } class ImplementationClass : ISubInterface { …
Simon Mattes
  • 4,866
  • 2
  • 33
  • 53
8
votes
3 answers

Page with type parameter

I would like to use new feature of UWP -> x:Bind. In order to that, all my pages need to have ViewModel property (as described in tutorials). To avoid code duplicity, I have established base class as follows: public abstract class BasePage
Viktor Szekeress
  • 175
  • 1
  • 13
5
votes
3 answers

WPF c# .net framework 4.8 x:Bind

I read about x:Bind, it has better performance vs Binding. But in my application WPF C# with .NET Framework 4.8 when I put x:Bind in any part (TextBox Text="{x:Bind ...}"), Visual Studio say to me "Bind is not supported in a Windows Presentation…
Anton Nikolayevich
  • 579
  • 1
  • 5
  • 19
5
votes
1 answer

Binding data into ListView through x:bind in UWP

I am using the hubsection in my program and in there is a ListView. but I am not able to bind the data to ListView. I had tried using {binding} but I am getting blank in output and when using the x:bind I am getting error that is No…
Ravi
  • 189
  • 1
  • 15
5
votes
2 answers

x:Bind StackOverflow when trying to x:Bind ListView.SelectedItem using TwoWay mode

I'm trying to bind ListView.SelectedItem using new x:Bind. My…
RTDev
  • 866
  • 7
  • 17
5
votes
1 answer

x:Bind Design Time issues

I am trying to build my UWP app and currently am stuck with designer exceptions when trying to use DataTemplate with x:Bind in a Resource Dictionary. I have created a Resource Dictionary "ItemTemplates.xaml" with a respective code-behind (to ensure…
Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
4
votes
1 answer

UWP : How to use x:bind in ResourceDictionary?

I want to use ResourceDictionary in UWP like I used in WPF In WPF, I do this in ResourceDictionary file(*Style.xaml)
Oh My Dog
  • 781
  • 13
  • 32
4
votes
3 answers

How to change default mode of x:Bind?

I don't know why they decided to set default value for Mode to OneTime But that's not what I want most of the time. It wasted my whole day in debugging. Is there a way to set OneWay value as default for Mode of x:Bind ?