private void BRD_Action_PointerExited(object sender, PointerRoutedEventArgs e) { if (!IsSelected) { BRD_Action.Background = new SolidColorBrush(ColorHandler.FromHex("#7FFFFFFF")); } }
public void BindData(Tenant project, List <Twin> twins) { if (project != null) { Project = project; Twins = twins; TB_Title.Text = Project.Name; TB_Hostname.Text = Project.Hostnames[0]; TB_NProjects.Text = Twins.Count.ToString(CultureInfo.InvariantCulture); RC_Color.Fill = new SolidColorBrush(ColorHandler.FromHex(project.FillColor, project.FillOpacity * 100)); RC_Color.Stroke = new SolidColorBrush(ColorHandler.FromHex(project.FillColor)); //BD_Actions_Main_Inner.Background = new SolidColorBrush(ColorHandler.FromHex(resourceLoader.GetString("BRD_Light_BGColor_Selected"))); //IMG_Main.Source = new BitmapImage(new Uri(resourceLoader.GetString("BRD_Actions_Devices_IMG_Selected"))); //CTRL_Action_REG.BindaData(); //CTRL_Action_RREG.BindaData(); //CTRL_Action_UPD.BindaData(); //CTRL_Action_PHIGH.BindaData(); //CTRL_Action_PF.BindaData(); //CTRL_Action_PLOW.BindaData(); //CTRL_Action_TEL0.BindaData(); //CTRL_Action_TEL50.BindaData(); //CTRL_Action_TEL100.BindaData(); //BindData_Devices(project.FillColor); //IsVisible = true; } }
public void BindData(Tenant project, List <Twin> twins) { if (project != null) { Project = project; Twins = twins; TB_Title.Text = Project.Name; TB_Hostname.Text = Project.Hostnames[0]; //TB_NProjects.Text = _Project.Items.Count.ToString(CultureInfo.InvariantCulture); TB_ProjectInfo_Main_NProjects.Text = twins.Count.ToString(CultureInfo.InvariantCulture); RC_Color.Fill = new SolidColorBrush(ColorHandler.FromHex(project.FillColor, project.FillOpacity * 100)); RC_Color.Stroke = new SolidColorBrush(ColorHandler.FromHex(project.FillColor)); BRD_NDevices_Top.BorderBrush = new SolidColorBrush(ColorHandler.FromHex(project.FillColor)); //BRD_NDevices_Top.Background = new SolidColorBrush(ColorHandler.FromHex(project.FillColor, project.FillOpacity * 100)); //BindData_Devices(project.FillColor); IsVisible = true; } }
private void UserControl_PointerEntered(object sender, PointerRoutedEventArgs e) { if (!IsSelected) { BRD_BTN_Main.Background = new SolidColorBrush(ColorHandler.FromHex(resourceLoader.GetString("BTN_Action_Pointer_Entered_BGColor"))); } }
public void Reset() { IsSelected = false; BRD_Action.Background = new SolidColorBrush(ColorHandler.FromHex("#7FFFFFFF")); IMG_Action.Source = new BitmapImage() { UriSource = new Uri(IMGSource) }; }
private void SetStyleTextboxes(bool isSelected) { BRD_Main.Background = isSelected ? new SolidColorBrush(ColorHandler.FromHex("#FF333333")) : new SolidColorBrush(ColorHandler.FromHex("#FFFFFFFF")); TB_Environment.Foreground = isSelected ? new SolidColorBrush(ColorHandler.FromHex("#F2FFFFFF")) : new SolidColorBrush(ColorHandler.FromHex("#FF333333")); TB_HostName.Foreground = isSelected ? new SolidColorBrush(ColorHandler.FromHex("#CCFFFFFF")) : new SolidColorBrush(ColorHandler.FromHex("#FF333333")); TB_NTenants.Foreground = isSelected ? new SolidColorBrush(ColorHandler.FromHex("#F2FFFFFF")) : new SolidColorBrush(ColorHandler.FromHex("#FF333333")); TB_NDevices.Foreground = isSelected ? new SolidColorBrush(ColorHandler.FromHex("#F2FFFFFF")) : new SolidColorBrush(ColorHandler.FromHex("#FF333333")); TB_NTenants_Lead.Foreground = isSelected ? new SolidColorBrush(ColorHandler.FromHex("#F2FFFFFF")) : new SolidColorBrush(ColorHandler.FromHex("#FF333333")); TB_NDevices_Lead.Foreground = isSelected ? new SolidColorBrush(ColorHandler.FromHex("#F2FFFFFF")) : new SolidColorBrush(ColorHandler.FromHex("#FF333333")); }
private void BRD_PointerEntered(object sender, PointerRoutedEventArgs e) { if (IsSelected) { return; } Border border = sender as Border; border.Background = new SolidColorBrush(ColorHandler.FromHex("#0C000000")); }
private void BindProjects(List <Tenant> projects) { TB_NDevices_Filtered.Text = projects.Count.ToString(CultureInfo.InvariantCulture); GRD_Projects_List.Children.Clear(); int column = 1; int line = 1; double marginLeft; double marginTop = DefaultMargin; int projectMaxSize = ProjectMaxSize(); SP_Projects_Info_Top.Height = NRows * ItemHeight + (NRows - 2) * DefaultMarginTop - SP_Projects_Info_Top.Margin.Bottom - 100; TB_FilterProjects.Width = (NColumns * ItemWidth) - ((NColumns - 2) * DefaultMargin) + 2; foreach (var project in projects) { if (project != null) { if (column <= NColumns) { marginLeft = (column - 1) * ItemWidth + column * DefaultMargin; column++; } else { marginLeft = DefaultMargin; marginTop = line * ItemHeight + (line + 1) * DefaultMarginTop; column = 2; line++; } UC_Projects_Item project_item = new UC_Projects_Item() { Margin = new Thickness(marginLeft, marginTop, DefaultMargin, 0), ItemWidth = ItemWidth, ItemHeight = ItemHeight, VerticalAlignment = VerticalAlignment.Top, HorizontalAlignment = HorizontalAlignment.Left, BRDColor = new SolidColorBrush(ColorHandler.FromHex(project.FillColor)), BGColor = new SolidColorBrush(ColorHandler.FromHex(project.FillColor)) }; project_item.ItemTapped += Project_item_ItemTapped; project_item.BindData(project, projectMaxSize); GRD_Projects_List.Children.Add(project_item); } } }
private void BRD_PointerExited(object sender, PointerRoutedEventArgs e) { if (IsSelected) { return; } Border border = sender as Border; border.Background = IsSelected ? new SolidColorBrush(ColorHandler.FromHex("#FF333333")) : new SolidColorBrush(ColorHandler.FromHex("#00FFFFFF")); }
private void SetImage() { if (IsSelected) { BRD_Action.Background = new SolidColorBrush(ColorHandler.FromHex("#FF333333")); IMG_Action.Source = new BitmapImage() { UriSource = new Uri(IMGAltSource) }; } else { BRD_Action.Background = new SolidColorBrush(ColorHandler.FromHex("#7FFFFFFF")); IMG_Action.Source = new BitmapImage() { UriSource = new Uri(IMGSource) }; } }
private static void SetStyleScoreElements(Grid gridElement, bool isSelected, int nElements) { int i = 0; foreach (Rectangle child in gridElement.Children) { if (isSelected) { child.Fill = i <= nElements ? new SolidColorBrush(ColorHandler.FromHex("#F2FFFFFF")) : new SolidColorBrush(ColorHandler.FromHex("#FF333333")); child.Stroke = new SolidColorBrush(ColorHandler.FromHex("#AAFFFFFF")); } else { child.Fill = i <= nElements ? new SolidColorBrush(ColorHandler.FromHex("#FF333333")) : new SolidColorBrush(ColorHandler.FromHex("#4CFFFFFF")); child.Stroke = new SolidColorBrush(ColorHandler.FromHex("#4C333333")); } i++; } }
public void BindaData() { BRD_BTN_Main.Width = ItemWidth; BRD_BTN_Main.Height = ItemHeight; TB_Label.Text = Label; if (string.IsNullOrEmpty(ImageSource)) { //IMG_BTN.Visibility = Visibility.Collapsed; TB_Title.Text = Title; BRD_BTN_Main.BorderBrush = new SolidColorBrush(ColorHandler.FromHex("#FF363636")); BRD_BTN_Main.BorderThickness = new Thickness(0.5); BRD_BTN_Main.CornerRadius = new CornerRadius(3); } else { IMG_BTN.Source = new BitmapImage(new Uri(resourceLoader.GetString(ImageSource))); } }
private async void AddMapElements_Projects(bool centerOnTarget) { await Dispatcher.RunAsync(CoreDispatcherPriority.Low, () => { Coordinates = new List <Windows.Devices.Geolocation.BasicGeoposition>(); var zindex = 1000; var strokeColor = ColorHandler.FromHex(Project.FillColor); var mapProjects = new List <MapElement>(); Coordinates.AddRange(GeoPositionConversor.Parse(Project.Coordinates)); var mapPolygon = new MapPolygon { Tag = Project.Name, Path = new Geopath(Coordinates), ZIndex = zindex, FillColor = FillColor, StrokeColor = strokeColor, StrokeThickness = 3, StrokeDashed = false, }; mapProjects.Add(mapPolygon); var mapProjectsLayer = new MapElementsLayer { ZIndex = zindex, MapElements = mapProjects }; MapLayers.Add(mapProjectsLayer); CTRL_Map_Main.Layers.Add(mapProjectsLayer); }); if (centerOnTarget) { await CTRL_Map_Main.TrySetViewBoundsAsync(GeoboundingBox.TryCompute(Coordinates), new Thickness(200), MapAnimationKind.Bow); } }
public void BindData(Tenant project, EnvironmentHandler.Type environment) { if (project is null) { return; } MapLayers = new List <MapElementsLayer>(); Project = project; EnvironmentT = environment; var area = GeopositionHandler.GetAreaInKmFromCoordinates(Project.Coordinates, 1); var perimeter = GeopositionHandler.GetPerimeterInKmFromCoordinates(Project.Coordinates, 1); var projectName = TextHandler.GetOnlyAlphabetChars(Project.Name); var projectNameLength = Math.Min(projectName.Length, 3); TB_Title_Prefix.Text = projectNameLength > 0 ? projectName.Substring(0, projectNameLength).ToUpperInvariant() : string.Empty; TB_ProjectName.Text = Project.Name; TB_Title.Text = Project.Name; TB_Timezone.Text = Project.Timezone; TB_NDevices.Text = Project.NDevices.ToString(CultureInfo.InvariantCulture); TB_Area.Text = string.Format(CultureInfo.InvariantCulture, "{0:### ### ###.#}", area); TB_Perimeter.Text = string.Format(CultureInfo.InvariantCulture, "{0:### ### ###.#}", perimeter); FillColor = ColorHandler.FromHex(Project.FillColor, Project.FillOpacity * 255); BRD_Info_BT.Background = new SolidColorBrush(ColorHandler.FromHex(Project.FillColor, 200)); BRD_Info_Title.Background = new SolidColorBrush(ColorHandler.FromHex(Project.FillColor, 200)); Scheduler.Start(); if (!MapControlLoaded) { InitializeMapControl(); } }
private async void SetStatusControlsStyle() { await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.High, () => { switch (Status) { case RunBookItem.Status.INI: SP_Status.Background = new SolidColorBrush(ColorHandler.FromHex("#FFF5F5F5")); BRD_BTN_Done.BorderBrush = new SolidColorBrush(ColorHandler.FromHex("#35000000")); TB_Status.Foreground = new SolidColorBrush(ColorHandler.FromHex("#FF333333")); TB_Status.Text = "NOT STARTED"; IsAllowedStart = true; IsAllowedPause = false; IsAllowedStop = true; IMG_Media_Start.Opacity = 1; IMG_Media_Pause.Opacity = .21; IMG_Media_Stop.Opacity = 1; break; case RunBookItem.Status.RUN: SP_Status.Background = new SolidColorBrush(ColorHandler.FromHex("#FFC90000")); BRD_BTN_Done.BorderBrush = new SolidColorBrush(ColorHandler.FromHex("#FFFFFFFF")); TB_Status.Foreground = new SolidColorBrush(ColorHandler.FromHex("#FFFFFFFF")); TB_Status.Text = "RUNNING"; IsAllowedStart = false; IsAllowedPause = true; IsAllowedStop = true; IMG_Media_Start.Opacity = .21; IMG_Media_Pause.Opacity = 1; IMG_Media_Stop.Opacity = 1; break; case RunBookItem.Status.PAU: SP_Status.Background = new SolidColorBrush(ColorHandler.FromHex("#FFF5F5F5")); BRD_BTN_Done.BorderBrush = new SolidColorBrush(ColorHandler.FromHex("#35000000")); TB_Status.Foreground = new SolidColorBrush(ColorHandler.FromHex("#FF333333")); TB_Status.Text = "PAUSED"; IsAllowedStart = true; IsAllowedPause = false; IsAllowedStop = true; IMG_Media_Start.Opacity = 1; IMG_Media_Pause.Opacity = .21; IMG_Media_Stop.Opacity = 1; break; case RunBookItem.Status.WAI: SP_Status.Background = new SolidColorBrush(ColorHandler.FromHex("#FFF5F5F5")); BRD_BTN_Done.BorderBrush = new SolidColorBrush(ColorHandler.FromHex("#35000000")); TB_Status.Foreground = new SolidColorBrush(ColorHandler.FromHex("#FF333333")); TB_Status.Text = "HOLDING"; IsAllowedStart = false; IsAllowedPause = false; IsAllowedStop = true; IMG_Media_Start.Opacity = 1; IMG_Media_Pause.Opacity = .21; IMG_Media_Stop.Opacity = 1; break; case RunBookItem.Status.STP: SP_Status.Background = new SolidColorBrush(ColorHandler.FromHex("#FFF5F5F5")); BRD_BTN_Done.BorderBrush = new SolidColorBrush(ColorHandler.FromHex("#35000000")); TB_Status.Foreground = new SolidColorBrush(ColorHandler.FromHex("#FF333333")); TB_Status.Text = "CANCELED"; IsAllowedStart = false; IsAllowedPause = false; IsAllowedStop = false; IMG_Media_Start.Opacity = .21; IMG_Media_Pause.Opacity = .21; IMG_Media_Stop.Opacity = .21; break; case RunBookItem.Status.FIN: SP_Status.Background = new SolidColorBrush(ColorHandler.FromHex("#FF2F5F00")); BRD_BTN_Done.BorderBrush = new SolidColorBrush(ColorHandler.FromHex("#FFFFFFFF")); TB_Status.Foreground = new SolidColorBrush(ColorHandler.FromHex("#FFFFFFFF")); TB_Status.Text = "FINISHED"; IsAllowedStart = false; IsAllowedPause = false; IsAllowedStop = false; IMG_Media_Start.Opacity = .21; IMG_Media_Pause.Opacity = .21; IMG_Media_Stop.Opacity = .21; break; default: break; } }); }
private void BRD_Remove_PointerEntered(object sender, PointerRoutedEventArgs e) { TB_Remove.Foreground = new SolidColorBrush(ColorHandler.FromHex("#FFDC0505")); }
private void BRD_Remove_PointerExited(object sender, PointerRoutedEventArgs e) { BRD_Remove.Background = new SolidColorBrush(ColorHandler.FromHex("#FFFFFFFF")); TB_Remove.Foreground = new SolidColorBrush(ColorHandler.FromHex("#FF404040")); }
private void SetCategoryControlsStyle(string color) { BRD_Category.Background = new SolidColorBrush(ColorHandler.FromHex(color)); BRD_Category.BorderBrush = new SolidColorBrush(ColorHandler.FromHex(color)); }
private void BRD_Info_BT_PointerExited(object sender, PointerRoutedEventArgs e) { BRD_Info_BT.Background = new SolidColorBrush(ColorHandler.FromHex(Project.FillColor, 200)); BRD_Info_Title.Background = new SolidColorBrush(ColorHandler.FromHex(Project.FillColor, 200)); }
private static void SetBorderBackgroundColor(Border border, bool pointerEntered) { border.Background = new SolidColorBrush(pointerEntered ? ColorHandler.FromHex("#FFFFFFFF") : ColorHandler.FromHex("#7FFFFFFF")); }
private void BRD_Main_PointerExited(object sender, PointerRoutedEventArgs e) { BRD_Main.Background = new SolidColorBrush(ColorHandler.FromHex("#00FFFFFF")); }