Ejemplo n.º 1
0
        public void LoadFilters()
        {
            var bw = new ImageFilter(new BlackAndWhite());
            var sepia = new ImageFilter(new Sepia()) { Value = 20 };
            var brightness = new ImageFilter(new Brightness()) { Value = 20 };
            var contrast = new ImageFilter(new Contrast()) { Value = 20 };

            var filters = new ObservableCollection<ImageFilter> { bw, sepia };

            bool isBrightnessBought;
            if (IsolatedStorageSettings.ApplicationSettings.TryGetValue(InAppProducts.BrightnessFilterIdentifier,
                                                                        out isBrightnessBought))
            {
                if (isBrightnessBought)
                {
                    filters.Add(brightness);
                }
            }
            bool isContrastBought;
            if (IsolatedStorageSettings.ApplicationSettings.TryGetValue(InAppProducts.ContrastFilterIdentifier,
                                                                        out isContrastBought))
            {
                if (isContrastBought)
                {
                    filters.Add(contrast);
                }
            }

            Filters = filters;
            SelectedFilter = Filters.First();
        }
Ejemplo n.º 2
0
        public void LoadFilters()
        {
            var bw    = new ImageFilter(new BlackAndWhite());
            var sepia = new ImageFilter(new Sepia())
            {
                Value = 20
            };
            var brightness = new ImageFilter(new Brightness())
            {
                Value = 20
            };
            var contrast = new ImageFilter(new Contrast())
            {
                Value = 20
            };

            var filters = new ObservableCollection <ImageFilter> {
                bw, sepia
            };

            bool isBrightnessBought;

            if (IsolatedStorageSettings.ApplicationSettings.TryGetValue(InAppProducts.BrightnessFilterIdentifier,
                                                                        out isBrightnessBought))
            {
                if (isBrightnessBought)
                {
                    filters.Add(brightness);
                }
            }
            bool isContrastBought;

            if (IsolatedStorageSettings.ApplicationSettings.TryGetValue(InAppProducts.ContrastFilterIdentifier,
                                                                        out isContrastBought))
            {
                if (isContrastBought)
                {
                    filters.Add(contrast);
                }
            }

            Filters        = filters;
            SelectedFilter = Filters.First();
        }