/// <summary> /// Initialize Ben's user info /// </summary> /// <returns></returns> private static SortingBoxInfo InitBen() { SortingBoxInfo sortingBoxInfo = new SortingBoxInfo(); sortingBoxInfo.sortingBoxPosition = new Point(Screen.WIDTH / 2, Screen.HEIGHT - DISTANCETOEDGE); sortingBoxInfo.sortingBoxScale = 1; sortingBoxInfo.SortingBoxRotation = 0; return(sortingBoxInfo); }
/// <summary> /// Initialize Alex's user info /// </summary> /// <returns></returns> private static SortingBoxInfo InitAlex() { SortingBoxInfo sortingBoxInfo = new SortingBoxInfo(); sortingBoxInfo.sortingBoxPosition = new Point(DISTANCETOEDGE, Screen.HEIGHT / 2); sortingBoxInfo.sortingBoxScale = 1; sortingBoxInfo.SortingBoxRotation = 90; return(sortingBoxInfo); }
/// <summary> /// Initialize Chris's user info /// </summary> /// <returns></returns> private static SortingBoxInfo InitChris() { SortingBoxInfo sortingBoxInfo = new SortingBoxInfo(); sortingBoxInfo.sortingBoxPosition = new Point(Screen.WIDTH - DISTANCETOEDGE, Screen.HEIGHT / 2); sortingBoxInfo.sortingBoxScale = 1; sortingBoxInfo.SortingBoxRotation = 270; return(sortingBoxInfo); }
/// <summary> /// Initialize Danny's user info /// </summary> /// <returns></returns> private static SortingBoxInfo InitDanny() { SortingBoxInfo sortingBoxInfo = new SortingBoxInfo(); sortingBoxInfo.sortingBoxPosition = new Point(Screen.WIDTH / 2, DISTANCETOEDGE); sortingBoxInfo.sortingBoxScale = 1; sortingBoxInfo.sortingBoxRotation = 180; return(sortingBoxInfo); }
//Load UI component private void LoadUI(User user) { SortingBoxInfo info = SortingBoxInfo.GetSortingBoxInfo(user); this.Width = info.SortingBoxSize.Width; this.Height = info.SortingBoxSize.Height; position = info.SortingBoxPosition; sortingBoxScale = info.SortingBoxScale; rotation = info.SortingBoxRotation; UpdateTransform(); //initialize the background rectangle background = new Rectangle(); UIHelper.InitializeUI( new Point(-0.5 * info.SortingBoxSize.Width, -0.5 * info.SortingBoxSize.Height), 0, 1, new Size(info.SortingBoxSize.Width, info.SortingBoxSize.Height), background); background.Fill = new SolidColorBrush(Colors.Transparent); background.Stroke = new SolidColorBrush(info.SortingBoxColor); background.StrokeThickness = 5; this.Children.Add(background); textBlockTop = new TextBlock(); UIHelper.InitializeUI( new Point(-0.5 * info.SortingBoxSize.Width, -0.5 * info.SortingBoxSize.Height), 0, 1, new Size(info.SortingBoxSize.Width, info.SortingBoxSize.Height), textBlockTop); textBlockTop.Foreground = new SolidColorBrush(Colors.White); textBlockTop.Text = " " + this.name; textBlockTop.FontFamily = new FontFamily("Comic Sans MS"); textBlockTop.FontSize = 24; textBlockTop.FontWeight = FontWeights.Bold; textBlockTop.TextAlignment = TextAlignment.Left; textBlockTop.VerticalAlignment = VerticalAlignment.Center; textBlockBottom = new TextBlock(); UIHelper.InitializeUI( new Point(.5 * info.SortingBoxSize.Width, .5 * info.SortingBoxSize.Height), 180, 1, new Size(info.SortingBoxSize.Width, info.SortingBoxSize.Height), textBlockBottom); textBlockBottom.Foreground = new SolidColorBrush(Colors.White); textBlockBottom.Text = " " + this.name; textBlockBottom.FontFamily = new FontFamily("Comic Sans MS"); textBlockBottom.FontSize = 24; textBlockBottom.FontWeight = FontWeights.Bold; textBlockBottom.TextAlignment = TextAlignment.Left; this.Children.Add(textBlockTop); this.Children.Add(textBlockBottom); Canvas.SetZIndex(background, 3); Canvas.SetZIndex(textBlockTop, 2); Canvas.SetZIndex(textBlockBottom, 1); }