Example #1
0
        public void SetSample(SampleBase newSample)
        {
            // clean up the old sample
            if (sample != null)
            {
                sample.RefreshRequested -= OnRefreshRequested;
                sample.Destroy();
            }

            sample = newSample;

            // set the title
            var title = sample?.Title ?? "SkiaSharp for MacOS";

            Title = title;
            var window = View?.Window;

            if (window != null)
            {
                window.Title = title;
            }

            // prepare the sample
            if (sample != null)
            {
                sample.RefreshRequested += OnRefreshRequested;
                sample.Init();
            }

            // refresh the view
            OnRefreshRequested(null, null);
        }
Example #2
0
        //private SKImage lastImage;

        public DetailContentsPage(SampleBase showcase)
        {
            InitializeComponent();

            Sample         = showcase;
            BindingContext = this;
        }
Example #3
0
        public DetailContentsPage(SampleBase showcase)
        {
            InitializeComponent();

            textPaint = new SKPaint
            {
                TextSize    = 16,
                IsAntialias = true
            };

            Sample         = showcase;
            BindingContext = this;
        }
Example #4
0
        private void SetSample(SampleBase newSample)
        {
            // clean up the old sample
            if (sample != null)
            {
                sample.RefreshRequested -= OnRefreshRequested;
                sample.Destroy();
            }

            sample = newSample;

            var runtimeMode = string.Empty;

#if __WASM__
            runtimeMode = Environment.GetEnvironmentVariable("UNO_BOOTSTRAP_MONO_RUNTIME_MODE");
            if (runtimeMode.Equals("Interpreter", StringComparison.InvariantCultureIgnoreCase))
            {
                runtimeMode = " (Interpreted)";
            }
            else if (runtimeMode.Equals("FullAOT", StringComparison.InvariantCultureIgnoreCase))
            {
                runtimeMode = " (AOT)";
            }
            else if (runtimeMode.Equals("InterpreterAndAOT", StringComparison.InvariantCultureIgnoreCase))
            {
                runtimeMode = " (Mixed)";
            }
#endif

            // set the title
            titleBar.Text = (sample?.Title ?? $"SkiaSharp for Uno Platform") + runtimeMode;

            // prepare the sample
            if (sample != null)
            {
                sample.RefreshRequested += OnRefreshRequested;
                sample.Init();
            }

            // refresh the view
            OnRefreshRequested(null, null);
        }
Example #5
0
        private void OnSampleSelected(SampleBase sample)
        {
            // clean up the old sample
            if (currentSample != null)
            {
                currentSample.RefreshRequested -= OnRefreshRequested;
                currentSample.Destroy();
            }

            // update the selected sample
            currentSample = sample;

            // prepare the sample
            if (sample != null)
            {
                sample.RefreshRequested += OnRefreshRequested;
                sample.Init();
            }

            // refresh the view
            OnRefreshRequested(null, null);
        }
Example #6
0
        private void SetSample(SampleBase newSample)
        {
            // clean up the old sample
            if (sample != null)
            {
                sample.RefreshRequested -= OnRefreshRequested;
                sample.Destroy();
            }

            sample = newSample;

            // set the title
            Title = sample?.Title ?? "SkiaSharp for WPF";

            // prepare the sample
            if (sample != null)
            {
                sample.RefreshRequested += OnRefreshRequested;
                sample.Init();
            }

            // refresh the view
            OnRefreshRequested(null, null);
        }
Example #7
0
 private void OnSampleSelected(SampleBase sample)
 {
     SampleSelected?.Invoke(sample);
 }