示例#1
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     View = new AvaloniaView(this);
     if (_content != null)
     {
         View.Content = _content;
     }
     SetContentView(View);
     base.OnCreate(savedInstanceState);
 }
示例#2
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     RequestWindowFeature(WindowFeatures.NoTitle);
     View = new AvaloniaView(this);
     if (_content != null)
     {
         View.Content = _content;
     }
     SetContentView(View);
     TakeKeyEvents(true);
     base.OnCreate(savedInstanceState);
 }
示例#3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            View = new AvaloniaView(this);
            SetContentView(View);

            _viewModel = new ViewModelProvider(this).Get(Java.Lang.Class.FromType(typeof(AvaloniaViewModel))) as AvaloniaViewModel;

            if (_viewModel.Content != null)
            {
                View.Content = _viewModel.Content;
            }

            base.OnCreate(savedInstanceState);
        }
        internal IDisposable SubscribeView(AvaloniaView view)
        {
            lock (_lock)
            {
                _views.Add(view);

                if (_views.Count == 1)
                {
                    _choreographer.Task.Result.PostFrameCallback(this);
                }
            }

            return(Disposable.Create(
                       () =>
            {
                lock (_lock)
                {
                    _views.Remove(view);
                }
            }
                       ));
        }
 public ViewImpl(AvaloniaView avaloniaView) : base(avaloniaView)
 {
     View.Focusable    = true;
     View.FocusChange += ViewImpl_FocusChange;
 }