Esempio n. 1
0
        private void OnSharpnessChange(object source, SharpnessEventArgs args)
        {
            Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() =>
            {
                int min = Math.Min(args.MaximumSharpness, args.Max);

                PlayerMinSharpness     = args.Min;
                PlayerCurrentSharpness = args.Sharpness;
                PlayerMaxSharpness     = min;
                PlayerSharpnessLeft    = PlayerCurrentSharpness - PlayerMinSharpness;

                Sharpness = ((args.Sharpness - args.Min) / (double)(min - args.Min)) * SharpnessMaxWidth;
            }));
        }
Esempio n. 2
0
        private void OnSharpnessLevelChange(object source, SharpnessEventArgs args)
        {
            Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() =>
            {
                object downColor = TryFindResource($"SHARPNESS_{(args.Level - 1).ToString().ToUpperInvariant()}");
                object color     = TryFindResource($"SHARPNESS_{(args.Level).ToString().ToUpperInvariant()}");

                if (color != null)
                {
                    SharpnessColor = color as Brush;
                }

                int min = Math.Min(args.MaximumSharpness, args.Max);

                SharpnessLowerColor = downColor as Brush;

                PlayerMinSharpness     = args.Min;
                PlayerCurrentSharpness = args.Sharpness;
                PlayerMaxSharpness     = min;
                PlayerSharpnessLeft    = PlayerCurrentSharpness - PlayerMinSharpness;

                Sharpness = ((args.Sharpness - args.Min) / (double)(min - args.Min)) * SharpnessMaxWidth;
            }));
        }