Skip to content

Commit

Permalink
Simplifing state setting
Browse files Browse the repository at this point in the history
  • Loading branch information
niels9001 committed Aug 12, 2022
1 parent 0787399 commit a014377
Showing 1 changed file with 1 addition and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,36 +213,7 @@ private void SetOrientation()

private void SetIconPosition()
{
var position = "";

switch (this.IconPosition)
{
case IconPosition.LeftCenter:
position = nameof(IconPosition.LeftCenter); break;
case IconPosition.LeftTop:
position = nameof(IconPosition.LeftTop); break;
case IconPosition.LeftBottom:
position = nameof(IconPosition.LeftBottom); break;
case IconPosition.TopCenter:
position = nameof(IconPosition.TopCenter); break;
case IconPosition.TopLeft:
position = nameof(IconPosition.TopLeft); break;
case IconPosition.TopRight:
position = nameof(IconPosition.TopRight); break;
case IconPosition.RightCenter:
position = nameof(IconPosition.RightCenter); break;
case IconPosition.RightTop:
position = nameof(IconPosition.RightTop); break;
case IconPosition.RightBottom:
position = nameof(IconPosition.RightBottom); break;
case IconPosition.BottomCenter:
position = nameof(IconPosition.BottomCenter); break;
case IconPosition.BottomLeft:
position = nameof(IconPosition.BottomLeft); break;
case IconPosition.BottomRight:
position = nameof(IconPosition.BottomRight); break;
}
VisualStateManager.GoToState(this, position, true);
VisualStateManager.GoToState(this, nameof(this.IconPosition), true);
}
}

Expand Down

0 comments on commit a014377

Please sign in to comment.