예제 #1
0
        public WpfNativeNode(Node?parent, Context context, WpfNative <TNative> element) : base(parent, context, element)
        {
            control = element.Create();

            var layerNode = new NativeLayerNode(control);

            layer = (NativeLayer)context.Layer.AddChild(layerNode);
            Element.Update(control);
        }
예제 #2
0
        protected override void UpdateElement(WpfNative <TNative> oldElement, Context oldContext)
        {
            if (oldContext.Layer != Context.Layer)
            {
                layer.Dispose();

                var layerNode = new NativeLayerNode(control);
                layer = (NativeLayer)Context.Layer.AddChild(layerNode);
            }

            Element.Update(control);
        }