Beispiel #1
0
        /// <summary>
        /// Deletes the group.
        /// </summary>
        /// <param name="g">The g.</param>
        /// <remarks>...</remarks>
        public void DeleteGroup(TileControlsGroupBarSettings g)
        {
            if (Settings.Current.TileScreenGroups.Count <= 1)
            {
                return;
            }

            var index    = 0;
            var atcolumn = 0;

            for (var i = 0; i < Settings.Current.TileScreenGroups.Count; i++)
            {
                index     = i;
                atcolumn += Settings.Current.TileScreenGroups[i].Column;
                if (Settings.Current.TileScreenGroups[i].Id == g.Id)
                {
                    break;
                }
            }

            Settings.Current.TileScreenGroups.RemoveAt(index);
            TilesControlGroupsHost.Children.RemoveAt(index);

            Unload(atcolumn - g.Column, g.Column);
            ThreadingExtensions.LazyInvokeThreadSafe(() => PushAtColumnBy(atcolumn, -g.Column), 100.0);
        }
Beispiel #2
0
        /// <summary>
        /// Gets the group start column.
        /// </summary>
        /// <param name="g">The g.</param>
        /// <returns>System.Int32.</returns>
        /// <remarks>...</remarks>
        public int GetGroupStartColumn(TileControlsGroupBarSettings g)
        {
            var atcolumn = 0;

            for (var i = 0; i < Settings.Current.TileScreenGroups.Count; i++)
            {
                atcolumn += Settings.Current.TileScreenGroups[i].Column;
                if (Settings.Current.TileScreenGroups[i].Id != g.Id)
                {
                    continue;
                }
                break;
            }

            return(atcolumn);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TileControlsGroupBar"/> class.
        /// </summary>
        public TileControlsGroupBar(TilesControl tilesControl, TileControlsGroupBarSettings tileControlsGroupBarSettings)
        {
            InitializeComponent();

            this.tilesControl = tilesControl;
            this.tileControlsGroupBarSettings = tileControlsGroupBarSettings;

            if (tileControlsGroupBarSettings.Column == 0 || tileControlsGroupBarSettings.Column == -1)
            {
                tileControlsGroupBarSettings.Column = 6;
            }

            Width      = tileControlsGroupBarSettings.Column * Settings.Current.MinTileWidth;
            Background = new SolidColorBrush(Settings.Current.ToolbarBackgroundColor)
            {
                Opacity = 0.5
            };
            this.TextBlock_Add.Opacity    = 0.0;
            this.TextBlock_Delete.Opacity = 0.0;
        }
Beispiel #4
0
        /// <summary>
        /// Adds the new group.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <remarks>...</remarks>
        public void AddNewGroup(TileControlsGroupBarSettings source)
        {
            var index    = 1;
            var atcolumn = source.Column;

            for (var i = 0; i < Settings.Current.TileScreenGroups.Count; i++)
            {
                index = i + 1;
                if (Settings.Current.TileScreenGroups[i].Id == source.Id)
                {
                    break;
                }
                atcolumn += Settings.Current.TileScreenGroups[i].Column;
            }

            var g = new TileControlsGroupBarSettings();

            Settings.Current.TileScreenGroups.Insert(index, g);
            TilesControlGroupsHost.Children.Insert(index, new TileControlsGroupBar(this, g));

            PushAtColumnBy(atcolumn, g.Column);
        }