vb.net - Windows 10 Universal App compiled Bindings / x:bind not working -
i've got following code test out new compiled bindings in universal windows 10 apps.
xaml:
<page x:class="xbindtest.mainpage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:xbindtest" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" datacontext="{binding relativesource={relativesource self}}"> <grid background="{themeresource applicationpagebackgroundthemebrush}"> <stackpanel horizontalalignment="center" verticalalignment="center"> <textblock x:name="tester" text="{x:bind mybindclass.testtext, mode=oneway}" ></textblock> <textblock x:name="tester2" text="{binding mybindclass.testtext, mode=oneway}" ></textblock> <button x:name="button" content="button" horizontalalignment="stretch" verticalalignment="stretch"/> </stackpanel> </grid>
code behind:
public class xbindclass : implements inotifypropertychanged private _testtext string public property testtext string return _testtext end set(value string) if _testtext <> value _testtext = value notifypropertychanged("testtext") end if end set end property public event propertychanged propertychangedeventhandler implements inotifypropertychanged.propertychanged private sub notifypropertychanged(<callermembername> optional propertyname string = "") raiseevent propertychanged(me, new propertychangedeventargs(propertyname)) end sub end class ''' <summary> ''' empty page can used on own or navigated within frame. ''' </summary> public notinheritable class mainpage inherits page public property mybindclass xbindclass public sub new() ' add initialization after initializecomponent() call. mybindclass = new xbindclass {.testtext = "hello"} ' call required designer. initializecomponent() end sub private sub button_click(sender object, e routedeventargs) handles button.click mybindclass.testtext &= " there" tester.datacontext = mybindclass.testtext end sub end class
i'm testing 2 binding types side side... standard {binding...} type working fine, new x:bind isn't working strangely...
perhaps i'm misunderstanding how new binding works? understood, x:bind bound codebehind, , required public property bind to, , off , running.
i'm using vs2015 rc , win 10 build 10130.
turns out x:bind
isn't implemented in vb.net vs2015rc.ms have confirmed implemented in full rtm
Comments
Post a Comment