Exemple #1
0
 public override void Dispose()
 {
     Settings?.Save();
     ViewData?.Dispose();
     paintController?.Dispose();
     Display?.Dispose();
     base.Dispose();
 }
Exemple #2
0
        // NB: le traitement des events SizeChanged est inutile: il est fait en interne

        static void OnCommandListFactoryChanged(BindableObject bindable, object oldValue, object newValue)
        {
            var veldridview = bindable as VeldridView;

            if (veldridview == null)
            {
                return;
            }

            if (oldValue != null)
            {
                bool _old = ViewData.Dispose(veldridview);
                if (_old)
                {
                    veldridview.OnRendererSet -= Veldridview_OnRendererSet;
                    veldridview.OnUpdate      -= Veldridview_OnUpdate;
                }
            }

            ICommandListFactory _newValue = newValue as ICommandListFactory;

            if (_newValue == null)
            {
                return;
            }

            ViewData viewData = ViewData.Find(veldridview);

            if (viewData == null)
            {
                return;
            }

            viewData.commandListFactory = _newValue;

            veldridview.OnRendererSet += Veldridview_OnRendererSet;
            veldridview.OnUpdate      += Veldridview_OnUpdate;
        }