private void ChangeItem(ToggleButton bt) { int count = 0; for (int i = 0; i < _numItemsArr[_currentIndex]; i++) { LayoutToLayoutTarget target = (_targetsArr[_currentIndex])[i] as LayoutToLayoutTarget; LayoutToLayoutHost host = (_hostsArr[_currentIndex])[i] as LayoutToLayoutHost; host.BeginAnimating(false); ContainerViewUserControl hostcv = host.Child as ContainerViewUserControl; ToggleButton hostBt = hostcv.Minimize; if (hostBt.Equals(bt)) { Grid.SetRow(target, 0); Grid.SetColumn(target, 0); Grid.SetRowSpan(target, _numItemsArr[_currentIndex] - 1); Grid.SetColumnSpan(target, 1); //hostBt.IsChecked = true; } else { Grid.SetRow(target, count); Grid.SetColumn(target, 1); Grid.SetRowSpan(target, 1); Grid.SetColumnSpan(target, 1); hostBt.IsChecked = false; count++; } } }
private void MedToLar(ToggleButton bt) { _flagArr[_currentIndex] = true; _gridChildrenArr[_currentIndex, 0].Children.Clear(); int count = 0; for (int i = 0; i < _numItemsArr[_currentIndex]; i++) { LayoutToLayoutTarget target = (_targetsArr[_currentIndex])[i] as LayoutToLayoutTarget; LayoutToLayoutHost host = (_hostsArr[_currentIndex])[i] as LayoutToLayoutHost; host.BeginAnimating(false); ContainerViewUserControl hostcv = host.Child as ContainerViewUserControl; ToggleButton hostBt = hostcv.Minimize; if (hostBt.Equals(bt)) { Grid.SetRow(target, 0); Grid.SetColumn(target, 0); Grid.SetRowSpan(target, _numItemsArr[_currentIndex] - 1); Grid.SetColumnSpan(target, 1); } else { Grid.SetRow(target, count); Grid.SetColumn(target, 1); count++; } _gridChildrenArr[_currentIndex, 1].Children.Add(target); } }
private void LarToMed() { _flagArr[_currentIndex] = false; _gridChildrenArr[_currentIndex, 1].Children.Clear(); for (int i = 0; i < _numItemsArr[_currentIndex]; i++) { LayoutToLayoutTarget target = (_targetsArr[_currentIndex])[i] as LayoutToLayoutTarget; LayoutToLayoutHost host = (_hostsArr[_currentIndex])[i] as LayoutToLayoutHost; host.BeginAnimating(false); Grid.SetRow(target, i / _gridSizeArr[_currentIndex]); Grid.SetColumn(target, i % _gridSizeArr[_currentIndex]); Grid.SetRowSpan(target, 1); Grid.SetColumnSpan(target, 1); _gridChildrenArr[_currentIndex, 0].Children.Add(target); } }