private void showSideMenu_Click(object sender, RoutedEventArgs e) { DoubleAnimation da = new DoubleAnimation(); if (isMenuShowing) { HideAnimation(RegNummer, 186, 15); HideAnimation(SerieNr, 186, 15); HideAnimation(plassering, 186, 15); HideAnimation(Merknad, 186, 15); HideAnimation(year, 186, 15); HideAnimation(Type, 186, 15); HideAnimation(merknadLabel, 186, 15); HideAnimation(aarskontroll, 186, 15); HideAnimation(interLabel, 186, 15); HideAnimation(serieLabel, 186, 15); HideAnimation(plassLabel, 186, 15); HideAnimation(dateCheck, 186, 15); HideAnimation(AddBtn, 97, 15); HideAnimation(label, 152, 15); DoubleAnimation da2 = new DoubleAnimation(186, 15, TimeSpan.FromMilliseconds(200)); monthGrid.BeginAnimation(Grid.WidthProperty, da2); FadeAnimation(RegNummer, 1, 0); FadeAnimation(SerieNr, 1, 0); FadeAnimation(plassering, 1, 0); FadeAnimation(Merknad, 1, 0); FadeAnimation(year, 1, 0); FadeAnimation(Type, 1, 0); DoubleAnimation da3 = new DoubleAnimation(1, 0, TimeSpan.FromMilliseconds(200)); monthGrid.BeginAnimation(Grid.OpacityProperty, da3); FadeAnimation(label, 1, 0); FadeAnimation(aarskontroll, 1, 0); FadeAnimation(interLabel, 1, 0); FadeAnimation(merknadLabel, 1, 0); FadeAnimation(serieLabel, 1, 0); FadeAnimation(plassLabel, 1, 0); FadeAnimation(dateCheck, 1, 0); FadeAnimation(AddBtn, 1, 0); isMenuShowing = false; da.From = 206; da.To = 15; da.Duration = new Duration(TimeSpan.FromMilliseconds(200)); SideMenu.BeginAnimation(ColumnDefinition.MinWidthProperty, da); SetButtonImg(true); } else { da.From = 30; da.To = 206; da.Duration = new Duration(TimeSpan.FromMilliseconds(200)); SideMenu.BeginAnimation(ColumnDefinition.MinWidthProperty, da); HideAnimation(RegNummer, 15, 186); HideAnimation(SerieNr, 15, 186); HideAnimation(plassering, 15, 186); HideAnimation(Merknad, 15, 186); HideAnimation(year, 15, 186); HideAnimation(merknadLabel, 15, 186); HideAnimation(Type, 15, 186); HideAnimation(aarskontroll, 15, 186); HideAnimation(interLabel, 15, 186); HideAnimation(serieLabel, 15, 186); HideAnimation(plassLabel, 15, 186); HideAnimation(dateCheck, 15, 186); HideAnimation(AddBtn, 15, 97); HideAnimation(label, 15, 152); DoubleAnimation da2 = new DoubleAnimation(15, 186, TimeSpan.FromMilliseconds(200)); monthGrid.BeginAnimation(Grid.WidthProperty, da2); FadeAnimation(RegNummer, 0, 1); FadeAnimation(SerieNr, 0, 1); FadeAnimation(plassering, 0, 1); FadeAnimation(Merknad, 0, 1); FadeAnimation(year, 0, 1); FadeAnimation(Type, 0, 1); DoubleAnimation da3 = new DoubleAnimation(0, 1, TimeSpan.FromMilliseconds(200)); monthGrid.BeginAnimation(Grid.OpacityProperty, da3); FadeAnimation(label, 0, 1); FadeAnimation(aarskontroll, 0, 1); FadeAnimation(interLabel, 0, 1); FadeAnimation(merknadLabel, 0, 1); FadeAnimation(serieLabel, 0, 1); FadeAnimation(plassLabel, 0, 1); FadeAnimation(dateCheck, 0, 1); FadeAnimation(AddBtn, 0, 1); isMenuShowing = true; SetButtonImg(false); } }