private void InitiateZoneCheckBoxes()// Compare New Report's InitiateZones() { //ZoneChoiceComboSnapped.ItemsSource = App.ZoneChoices.GetZoneChoices(); // Instantiate zone buttons: zcbCount = App.ZoneChoices.GetZoneChoiceList().Count; App.MyAssert(zcbCount > 0); zcb = new ZoneCheckBox[zcbCount]; int i = 0; string checkBoxName; foreach (TP_ZoneChoiceItem zci in App.ZoneChoices.GetZoneChoiceList()) { if (String.IsNullOrEmpty(zci.ButtonName)) continue; checkBoxName = "zoneCheckBox" + zci.ButtonName.Replace(" ", ""); zcb[i] = new ZoneCheckBox(checkBoxName, (Color)zci.ColorObj, zci.ButtonName); zcb[i].Click += ZoneCheckBox_Click; ToolTip tt = new ToolTip(); tt.Content = zci.Meaning; zcb[i].SetToolTip(tt); ZoneCheckBoxes.Items.Add(zcb[i]); i++; } //Zone_Clear(); }
private UWPControls.StackPanel CreateInputStackPanel() { var inputStackPanel = new UWPControls.StackPanel(); UWPControls.Button getTokenButton = new UWPControls.Button(); getTokenButton.Content = "Lấy Facebook Token"; getTokenButton.Width = 300; getTokenButton.HorizontalAlignment = UWPXaml.HorizontalAlignment.Center; getTokenButton.Margin = new UWPXaml.Thickness(10); getTokenButton.SetBinding(UWPControls.Button.CommandProperty, new UWPXaml.Data.Binding() { Source = _viewModel, Path = new UWPXaml.PropertyPath("GetTokenCommand") }); UWPControls.PasswordBox passwordBox = new UWPControls.PasswordBox(); passwordBox.PlaceholderText = "Nhập password"; passwordBox.Width = 300; passwordBox.Margin = new UWPXaml.Thickness(10); passwordBox.PasswordChanged += (o, args) => { _viewModel.UserPassword = passwordBox.Password; }; //Thêm tooltip cho password TextBox UWPControls.ToolTip passwordToolTip = new UWPControls.ToolTip(); passwordToolTip.Content = "Để giảm thiểu khả năng checkpoint và tăng độ bảo mật, các bạn nên dùng Mật khẩu ứng dụng. Để lấy Mật khẩu ứng dụng: Cài đặt > Bảo mật và đăng nhập > Xác thực 2 yếu tố > Mật khẩu ứng dụng"; UWPControls.ToolTipService.SetToolTip(passwordBox, passwordToolTip); UWPControls.TextBox emailTextBox = new UWPControls.TextBox(); emailTextBox.PlaceholderText = "Nhập email"; emailTextBox.IsSpellCheckEnabled = false; emailTextBox.Width = 300; emailTextBox.Margin = new UWPXaml.Thickness(10); //https://github.com/Microsoft/XamlIslandBlogPostSample/blob/master/WpfApp1/BindingPage.xaml.cs emailTextBox.SetBinding(UWPControls.TextBox.TextProperty, new UWPXaml.Data.Binding() { Source = _viewModel, Path = new UWPXaml.PropertyPath("UserEmail"), UpdateSourceTrigger = UWPXaml.Data.UpdateSourceTrigger.PropertyChanged, Mode = UWPXaml.Data.BindingMode.TwoWay }); inputStackPanel.Children.Add(emailTextBox); inputStackPanel.Children.Add(passwordBox); inputStackPanel.Children.Add(getTokenButton); return(inputStackPanel); }
private void OnDisplayRequested(UIElement sender, AccessKeyDisplayRequestedEventArgs args) { var tooltip = new ToolTip { Background = new SolidColorBrush(Colors.Black), Foreground = new SolidColorBrush(Colors.White), Padding = new Thickness(4), VerticalOffset = -20, Placement = PlacementMode.Bottom, Content = sender.AccessKey }; ToolTipService.SetToolTip(sender, tooltip); tooltip.IsOpen = true; }
public Scenario2() { this.InitializeComponent(); // Initialize drawing attributes. These are used in inking mode. InkDrawingAttributes drawingAttributes = new InkDrawingAttributes(); drawingAttributes.Color = Windows.UI.Colors.Red; double penSize = 4; drawingAttributes.Size = new Windows.Foundation.Size(penSize, penSize); drawingAttributes.IgnorePressure = false; drawingAttributes.FitToCurve = true; // Show the available recognizers inkRecognizerContainer = new InkRecognizerContainer(); recoView = inkRecognizerContainer.GetRecognizers(); if (recoView.Count > 0) { foreach (InkRecognizer recognizer in recoView) { RecoName.Items.Add(recognizer.Name); } } else { RecoName.IsEnabled = false; RecoName.Items.Add("No Recognizer Available"); } RecoName.SelectedIndex = 0; // Set the text services so we can query when language changes textServiceManager = CoreTextServicesManager.GetForCurrentView(); textServiceManager.InputLanguageChanged += TextServiceManager_InputLanguageChanged; SetDefaultRecognizerByCurrentInputMethodLanguageTag(); // Initialize reco tooltip recoTooltip = new ToolTip(); recoTooltip.Content = InstallRecoText; ToolTipService.SetToolTip(InstallReco, recoTooltip); // Initialize the InkCanvas inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes); inkCanvas.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Mouse | Windows.UI.Core.CoreInputDeviceTypes.Pen | Windows.UI.Core.CoreInputDeviceTypes.Touch; this.Unloaded += Scenario2_Unloaded; this.SizeChanged += Scenario2_SizeChanged; }
public static void SetStationPin(Location location, Map map, Station station = null) { Image image = new Image(); image.Source = new BitmapImage(new Uri("ms-appx:/Assets/pushpin.gif")); image.Width = 24; image.Height = 32; image.Tag = station; if (station != null) { ToolTip stationTooltip = new ToolTip(); stationTooltip.Content = station.ToString(); ToolTipService.SetToolTip(image, stationTooltip); } MapLayer.SetPosition(image, location); MapLayer.SetPositionAnchor(image, new Windows.Foundation.Point(12, 32)); map.Children.Add(image); }
/// <summary> /// Initializes all tooltips for this page. /// </summary> private void InitializeTooltips() { const int tooltipFontsize = 20; ToolTip toolTip_BackButton = new ToolTip(); toolTip_BackButton.FontSize = tooltipFontsize; toolTip_BackButton.Content = KalahaResources.I.GetRes("Tooltip_GamePage_BackButton"); ToolTipService.SetToolTip(backButton, toolTip_BackButton); ToolTip toolTip_UndoButton = new ToolTip(); toolTip_UndoButton.FontSize = tooltipFontsize; toolTip_UndoButton.Content = KalahaResources.I.GetRes("Tooltip_GamePage_UndoButton"); ToolTipService.SetToolTip(undoButton, toolTip_UndoButton); ToolTip toolTip_PlayAgainButton = new ToolTip(); toolTip_PlayAgainButton.FontSize = tooltipFontsize; toolTip_PlayAgainButton.Content = KalahaResources.I.GetRes("Tooltip_GamePage_PlayAgainButton"); ToolTipService.SetToolTip(playAgainButton, toolTip_PlayAgainButton); ToolTip toolTip_NumberFieldOnButton = new ToolTip(); toolTip_NumberFieldOnButton.FontSize = tooltipFontsize; toolTip_NumberFieldOnButton.Content = KalahaResources.I.GetRes("Tooltip_GamePage_NumberFieldOnButton"); ToolTipService.SetToolTip(numberFieldOnButton, toolTip_NumberFieldOnButton); ToolTip toolTip_NumberFieldOffButton = new ToolTip(); toolTip_NumberFieldOffButton.FontSize = tooltipFontsize; toolTip_NumberFieldOffButton.Content = KalahaResources.I.GetRes("Tooltip_GamePage_NumberFieldOffButton"); ToolTipService.SetToolTip(numberFieldOffButton, toolTip_NumberFieldOffButton); ToolTip toolTip_PlayerPositionSameSideButton = new ToolTip(); toolTip_PlayerPositionSameSideButton.FontSize = tooltipFontsize; toolTip_PlayerPositionSameSideButton.Content = KalahaResources.I.GetRes("Tooltip_GamePage_PlayerPositionSameSideButton"); ToolTipService.SetToolTip(playerPositionSameSideButton, toolTip_PlayerPositionSameSideButton); ToolTip toolTip_PlayerPositionOppositeSidesButton = new ToolTip(); toolTip_PlayerPositionOppositeSidesButton.FontSize = tooltipFontsize; toolTip_PlayerPositionOppositeSidesButton.Content = KalahaResources.I.GetRes("Tooltip_GamePage_PlayerPositionOppositeSidesButton"); ToolTipService.SetToolTip(playerPositionOppositeSidesButton, toolTip_PlayerPositionOppositeSidesButton); }
protected override void OnApplyTemplate() { _toolTip = this.GetTemplateChild("PART_ToolTip") as ToolTip; _pointsPanel = this.GetTemplateChild("PART_PointsPanel") as Panel; _labelsPanel = this.GetTemplateChild("PART_LabelsPanel") as Panel; _indicator = this.GetTemplateChild("PART_Indicator") as Arc; _valueLine = this.GetTemplateChild("PART_ValueLine") as Line; _indicatorLine = this.GetTemplateChild("PART_IndicatorLine") as Line; _innerCircle = this.GetTemplateChild("PART_InnerCircle") as Ellipse; _outerCircle = this.GetTemplateChild("PART_OuterCircle") as Ellipse; _centerButton = this.GetTemplateChild("PART_CenterButton") as RadialImageButton; if (_innerCircle != null) { _innerCircle.PointerMoved += this.OnPointerMoved; } if (_outerCircle != null) { _outerCircle.PointerMoved += this.OnPointerMoved; } if (_centerButton != null) { _centerButton.Click += this.OnCenterButtonClick; } }
/// <summary> /// Refresh bottom app panel /// </summary> private void PrepareHolidayPanel() { Style style = (Style)this.Resources["HolidayFlyoutStyle"]; Brush foreg = (SolidColorBrush)Application.Current.Resources["HolidayTitleColor"]; Brush bg = (SolidColorBrush)Application.Current.Resources["MainColor"]; var listOfLVI = new List<ListViewItem>(); //prepare static holidays, if it's null if (lviAll == null) { //all and personal lviAll = new ListViewItem { Tag = "All", Content = DataManager.GetStringFromResourceLoader("AllHol"), Foreground = new SolidColorBrush(Colors.White), }; lviPers = new ListViewItem { Tag = "Per", Content = DataManager.GetStringFromResourceLoader("MineAsTag"), Foreground = foreg, }; lviEtc = new ListViewItem { Content = "...", Foreground = foreg }; lviEtc.Tapped += GridViewItem_Tapped; } listOfLVI.Add(lviAll); listOfLVI.Add(lviPers); var subcollection = LocalDataManager.GetSelectedCategoriesList(); for (int i = 0; i < subcollection.Count(); i++) { listOfLVI.Add(new ListViewItem { Content = subcollection.ElementAt(i).Key, Foreground = foreg, }); ToolTip tt = new ToolTip() { Content = subcollection.ElementAt(i).Value, Placement = PlacementMode.Top, FontSize = 16 }; ToolTipService.SetToolTip(listOfLVI[i + 2], tt); } listOfLVI.Add(lviEtc); //tapped for (int i = 0; i < listOfLVI.Count; i++) { listOfLVI[i].Background = bg; listOfLVI[i].Style = style; #if !WINDOWS_PHONE_APP if(sizeCorrection != null) { listOfLVI[i].Height = sizeCorrection.ItemSizeCorrector; listOfLVI[i].Width = sizeCorrection.ItemSizeCorrector; listOfLVI[i].FontSize = sizeCorrection.ItemSizeCorrector / 3; } #else listOfLVI[i].Height = Window.Current.Bounds.Width / 8; listOfLVI[i].Width = Window.Current.Bounds.Width / 8; listOfLVI[i].FontSize = Window.Current.Bounds.Width / 18; listOfLVI[i].Margin = new Thickness(5, 0, 5, 10); #endif if (i != listOfLVI.Count - 1) listOfLVI[i].Tapped += holTypes_Tapped; // else listOfLVI[i].FontSize *= 2; } //set source HolidayList.ItemsSource = listOfLVI; //end select "all" SelectedHolidayType = lviAll; UpdateNoteList(); }
private ListViewItem BuildRowStructure(double cellWidth, string id) { ListViewItem item = new ListViewItem(); item.Margin = new Thickness(0); item.Padding = new Thickness(0); Grid itemGrid = new Grid(); // the 1st column is the row Id and needs to be larger than // the other cells so it can hold the text ColumnDefinition idCol = new ColumnDefinition(); idCol.Width = new GridLength(FIRST_ROW_WIDTH); itemGrid.ColumnDefinitions.Add(idCol); // add a text block to the first column and set it to the row id TextBlock titleTextBlock = new TextBlock(); titleTextBlock.Text = id; titleTextBlock.TextTrimming = TextTrimming.WordEllipsis; ToolTip tt = new ToolTip(); tt.Content = id; tt.Placement = Windows.UI.Xaml.Controls.Primitives.PlacementMode.Mouse; ToolTipService.SetToolTip(titleTextBlock, tt); itemGrid.Children.Add(titleTextBlock); Grid.SetColumn(titleTextBlock, 0); // the rest of the columns are the data cells themselves for (int i = 0; i < this.Columns.Length; i++) { ColumnDefinition col = new ColumnDefinition(); col.Width = new GridLength(cellWidth); itemGrid.ColumnDefinitions.Add(col); } item.Content = itemGrid; return item; }
private void Draw() { _dataGrid.CollectionChanged -= dataGrid_CollectionChanged; _dataGrid.Clear(); // get colour scheme values from combobox selections ComboBoxItem nDataClassesSelection = numDataClassesComboBox.SelectedItem as ComboBoxItem; int nDataClasses = int.Parse(nDataClassesSelection.Content.ToString()); byte[][] defaultColourScheme = _colourScheme.GetRGBColours(colourSchemeComboBox.SelectedItem.ToString(), nDataClasses); for (int i = 0; i < _datasetModel.Dataset.Count; i++) { string[] row = _datasetModel.Dataset[i]; ListViewItem item = BuildRowStructure(_cellWidth, row[_idIndex]); Grid rowGrid = item.Content as Grid; for (int j = 0; j < this.Columns.Length; j++) { int currentColumn = _columnIndexes[j]; string columnTitle = _datasetModel.ColumnHeadings[currentColumn]; // get max and min for the column double[] minMax = _datasetModel.GetAxisMinMaxValues(columnTitle); double min = minMax[0]; double max = minMax[1]; double cellValue = double.Parse(row[currentColumn]); double linearTransform = (cellValue - min) / (max - min) * (nDataClasses - 1); int colourIndex = (int)Math.Truncate(linearTransform); byte[] colourRGB = defaultColourScheme[colourIndex]; Rectangle cell = new Rectangle(); cell.Stroke = new SolidColorBrush(Colors.LightGray); cell.StrokeThickness = 1; cell.Fill = new SolidColorBrush(Color.FromArgb(255, colourRGB[0], colourRGB[1], colourRGB[2])); ToolTip tt = new ToolTip(); tt.Content = row[currentColumn]; tt.Placement = Windows.UI.Xaml.Controls.Primitives.PlacementMode.Mouse; ToolTipService.SetToolTip(cell, tt); rowGrid.Children.Add(cell); // add to column + 1 to account for the row title Grid.SetColumn(cell, j + 1); } _dataGrid.Add(item); } _dataGrid.CollectionChanged += dataGrid_CollectionChanged; dataListView.ItemsSource = _dataGrid; // check for filtered items if (_filteredItems.Count > 0) { Filter(); } }
/* <Rectangle x:Name="BlinkerTopRed" x:FieldModifier="public" Height="15" Width="15" Fill="DarkRed" /> <Rectangle x:Name="BlinkerMiddleYellow" x:FieldModifier="public" Margin="0,4" Height="15" Width="15" Fill="DarkGoldenrod" /> <Rectangle x:Name="BlinkerBottomGreen" x:FieldModifier="public" Height="15" Width="15" Fill="DarkGreen" /> <TextBlock x:Name="CountInSendQueue" x:FieldModifier="public" Height="30" Width="40" Margin="0,10,0,0" FontSize="18" TextAlignment="Center" FontWeight="Bold" /> */ #endif public BasicPageNew() { this.InitializeComponent(); Window.Current.SizeChanged += VisualStateChanged; PatientIdTextBox.AddHandler(TappedEvent, new TappedEventHandler(PatientIdTextBox_Tapped), true); // pr == null in constructor pr = new TP_PatientReport(); // though elements may be null or empty App.MyAssert(App.CurrentPatient != null); if (String.IsNullOrEmpty(App.CurrentPatient.PatientID)) App.CurrentPatient.PatientID = App.CurrentOtherSettings.CurrentNewPatientNumber; // reload. Probably not good enough. App.MyAssert(!String.IsNullOrEmpty(App.CurrentPatient.PatientID)); // Should be loaded from OtherSettings.xml, or at generation associated with that. /// Maybe not: PatientIdTextBox.MaxLength = Convert.ToInt32(App.OrgPolicy.GetPatientIDMaxTextBoxLength()); if (!String.IsNullOrEmpty(App.CurrentPatient.Zone)) // This test may need refinement { pr = App.CurrentPatient; // Move to LoadState, needs to be after InitiateZones call: LoadReportFieldsFromObject(pr); // may not be the way to go in long term } else { PatientIdTextBox.Text = App.CurrentPatient.PatientID; // cheap initialization // This does not fire TextChanged, so we'll force it later in LoadState } // We'll check if ID is already in use later, in LoadState //Move to LoadState: InitiateZones(); App.ViewedDisaster.Clear(); // a little housecleaning for the benefit of ViewEditReportPage dt = new DispatcherTimer(); dt.Interval = new TimeSpan(0,0,0,0,500); // 500 milliseconds dt.Tick += dt_Tick; incrementPatientID.AddHandler(PointerPressedEvent, new PointerEventHandler(incrementPatientID_PointerPressed), true); decrementPatientID.AddHandler(PointerPressedEvent, new PointerEventHandler(decrementPatientID_PointerPressed), true); MyZoneButtonItemWidth = "140"; ToolTip trafficTip = new ToolTip(); trafficTip.Content = "Connection lag to TriageTrak. Red if 3+ seconds (or failed), green if < 1/2 second"; ToolTipService.SetToolTip(BlinkerTopRed, trafficTip); ToolTipService.SetToolTip(BlinkerMiddleYellow, trafficTip); ToolTipService.SetToolTip(BlinkerBottomGreen, trafficTip); ToolTip sendQueueTip = new ToolTip(); sendQueueTip.Content = "Count of reports queued to send"; ToolTipService.SetToolTip(CountInSendQueue, sendQueueTip); LastSentMsg.DataContext = this; patientID_ConflictStatus.Text = ""; // July 2015, v 5. Clear design-time string "[conflict status]" }
/// <summary> /// Invoked when video add button is clicked and choose the videos. /// </summary> /// <param name="sender">The video add button clicked.</param> /// <param name="e">Event data that describes how the click was initiated.</param> private async void VideoUploadButton_Click(object sender, RoutedEventArgs e) { FileOpenPicker picker = FileTypePicker(videosFilterTypeList); if (picker == null) return; videos = await picker.PickMultipleFilesAsync(); for (int i = 0; i < videos.Count; ++i) { Image videoImg = new Image { Source = new BitmapImage(new Uri("ms-appx:///Images/Upload/video.png")), Margin = new Thickness(5, 0, 5, 0) }; ToolTip toolTip = new ToolTip(); toolTip.Content = videos[i].Name; ToolTipService.SetToolTip(videoImg, toolTip); videosPanel.Children.Add(videoImg); } }
/// <summary> /// Generates my shared note item. /// </summary> /// <param name="id">The identifier.</param> /// <param name="title">The title.</param> /// <param name="content">The content.</param> /// <param name="user">The user.</param> /// <param name="time">The time.</param> /// <param name="lessonNum">The lesson number.</param> /// <returns></returns> public Grid GenerateMySharedNoteItem(int id, string title, string content, string user, DateTime time, int lessonNum) { TextBlock noteInfo = new TextBlock { Tag = id, FontSize = 45, Height = 50, Margin = new Thickness(5, 0, 0, 0), Foreground = new SolidColorBrush(Colors.White), HorizontalAlignment = HorizontalAlignment.Left, Text = title + " At " + time.Year.ToString() + "." + time.Month.ToString() + "." + time.Day.ToString(), IsTapEnabled = true }; noteInfo.Tapped += noteInfo_Tapped; ToolTip toolTip = new ToolTip() { Content = content, FontSize = 30, MaxWidth = 200 }; ToolTipService.SetToolTip(noteInfo, toolTip); Image deleteImage = new Image { Tag = id.ToString(), Source = new BitmapImage(new Uri("ms-appx:///Images/Coursing/Note/delete.png")), Margin = new Thickness(4, 0, -45, 0), Height = 40, Width = 40, HorizontalAlignment = HorizontalAlignment.Right, IsTapEnabled = true }; deleteImage.Tapped += deleteImage_Tapped; TextBlock lesson = new TextBlock { FontSize = 45, Height = 50, Margin = new Thickness(5, 0, 5, 0), Foreground = this.Resources["LessonForegroundBrush"] as SolidColorBrush, HorizontalAlignment = HorizontalAlignment.Right, Text = "L " + lessonNum }; Grid newNote = new Grid() { Background = this.Resources["NoteBackgroundBrush"] as SolidColorBrush, Margin = new Thickness(2, 2, 50, 2) }; newNote.Children.Add(noteInfo); newNote.Children.Add(deleteImage); newNote.Children.Add(lesson); return newNote; }
private bool deleteRequest = false; // added Dec 2014 public BasicPageViewEdit() { this.InitializeComponent(); Window.Current.SizeChanged += VisualStateChanged; PatientIdTextBox.AddHandler(TappedEvent, new TappedEventHandler(PatientIdTextBox_Tapped), true); //previousPdi = new TP_PatientReport(); updatedReport = new TP_PatientReport(); App.MyAssert(App.CurrentPatient != null); // though elements may be null or empty // Some items in NewReport's constructor have been moved to LoadState() here. InitiateZones(); dt = new DispatcherTimer(); dt.Interval = new TimeSpan(0, 0, 0, 0, 500); // 500 milliseconds dt.Tick += dt_Tick; incrementPatientID.AddHandler(PointerPressedEvent, new PointerEventHandler(incrementPatientID_PointerPressed), true); decrementPatientID.AddHandler(PointerPressedEvent, new PointerEventHandler(decrementPatientID_PointerPressed), true); MyZoneButtonItemWidth = "140"; ToolTip trafficTip = new ToolTip(); trafficTip.Content = "Connection lag to TriageTrak. Red if 3+ seconds (or failed), green if < 1/2 second"; ToolTipService.SetToolTip(BlinkerTopRed, trafficTip); ToolTipService.SetToolTip(BlinkerMiddleYellow, trafficTip); ToolTipService.SetToolTip(BlinkerBottomGreen, trafficTip); ToolTip sendQueueTip = new ToolTip(); sendQueueTip.Content = "Count of reports queued to send"; ToolTipService.SetToolTip(CountInSendQueue, sendQueueTip); // WAS: discardMenuPopUp = new Popup(); //discardMenuPopUp.Closed += (o, e) => this.GetParentOfType<AppBar>().IsOpen = false; // When popup closes, close app bar too. //discardMenuPopUp.Closed += (o, e) => TopAppBar.IsOpen = false; //discardMenuPopUp.Closed += (o, e) => BottomAppBar.IsOpen = false; patientID_ConflictStatus.Text = ""; // July 2015, v 5 }
private void InitiateZones() { ZoneChoiceComboSnapped.ItemsSource = App.ZoneChoices.GetZoneChoices(); // Instantiate zone buttons: int count = App.ZoneChoices.GetZoneChoiceList().Count; App.MyAssert(count > 0); ZoneButton[] zb = new ZoneButton[count]; int i = 0; string buttonName; foreach (TP_ZoneChoiceItem zci in App.ZoneChoices.GetZoneChoiceList()) { if (String.IsNullOrEmpty(zci.ButtonName)) continue; buttonName = "zoneButton" + zci.ButtonName.Replace(" ", ""); zb[i] = new ZoneButton(buttonName, (Color)zci.ColorObj, zci.ButtonName); zb[i].Click += Zone_Click; ToolTip tt = new ToolTip(); tt.Content = zci.Meaning; zb[i].SetToolTip(tt); ZoneButtons.Items.Add(zb[i]); /* // Make widths narrower for filled state: NOT WORKING YET ObjectAnimationUsingKeyFrames anim = new ObjectAnimationUsingKeyFrames(); DiscreteObjectKeyFrame kf = new DiscreteObjectKeyFrame(); kf.KeyTime = TimeSpan.FromSeconds(0); kf.Value = 100; anim.KeyFrames.Add(kf); Storyboard.SetTargetName(anim, buttonName); Storyboard.SetTargetProperty(anim, "ZoneButtonWidth"); Filled.Storyboard.Children.Add(anim); */ i++; } Zone_Clear(); // disables SendButton too }
public void SetToolTip(ToolTip t) { ToolTipService.SetToolTip(checkbox, t); }
/// <summary> /// Initializes all tooltips for this page. /// </summary> private void InitializeTooltips() { const int tooltipFontsize = 20; ToolTip toolTip_ContinueButton = new ToolTip(); toolTip_ContinueButton.FontSize = tooltipFontsize; toolTip_ContinueButton.Content = KalahaResources.I.GetRes("Tooltip_HubPage_ContinueButton"); ToolTipService.SetToolTip(continueButton, toolTip_ContinueButton); ToolTip toolTip_StartButton = new ToolTip(); toolTip_StartButton.FontSize = tooltipFontsize; toolTip_StartButton.Content = KalahaResources.I.GetRes("Tooltip_HubPage_StartButton"); ToolTipService.SetToolTip(startButton, toolTip_StartButton); }
public ToolTipEvents(ToolTip This) : base(This) { this.This = This; }
protected override void OnApplyTemplate() { _errorToolTip = GetTemplateChild("ErrorToolTip") as ToolTip; ErrorHint = GetTemplateChild("ErrorHint") as Button; base.OnApplyTemplate(); }
protected override void OnPointerEntered(PointerRoutedEventArgs e) { if (!this.Selected) { polyline.StrokeThickness = 3; polyline.Stroke = new SolidColorBrush(Colors.Yellow); } ToolTip toolTip = new ToolTip(); toolTip.Content = this.Details; toolTip.Placement = Windows.UI.Xaml.Controls.Primitives.PlacementMode.Mouse; ToolTipService.SetToolTip(this, toolTip); toolTip.IsOpen = true; }
public void InitiateZones() // may also be called from Settings/My Organization if org changes { ZoneChoiceComboSnapped.ItemsSource = App.ZoneChoices.GetZoneChoices(); // Instantiate zone buttons: zbCount = App.ZoneChoices.GetZoneChoiceList().Count; App.MyAssert(zbCount > 0); zb = new ZoneButton[zbCount]; int i = 0; string buttonName; foreach(TP_ZoneChoiceItem zci in App.ZoneChoices.GetZoneChoiceList()) { if (String.IsNullOrEmpty(zci.ButtonName)) continue; buttonName = "zoneButton"+zci.ButtonName.Replace(" ",""); zb[i] = new ZoneButton(buttonName, (Color)zci.ColorObj, zci.ButtonName); zb[i].Click += Zone_Click; ToolTip tt = new ToolTip(); tt.Content = zci.Meaning; zb[i].SetToolTip(tt); ZoneButtons.Items.Add(zb[i]); /* DOESNT WORK... BUT MAYBE BECAUSE IN CONSTRUCTOR? // Make widths narrower for filled state: ObjectAnimationUsingKeyFrames anim = new ObjectAnimationUsingKeyFrames(); DiscreteObjectKeyFrame kf = new DiscreteObjectKeyFrame(); kf.KeyTime = TimeSpan.FromSeconds(0); //kf.Value = 100; kf.SetValue(ZoneButton.ZoneButtonWidthProperty, 100); anim.KeyFrames.Add(kf); Storyboard.SetTargetName(anim, buttonName); // fails with exception when filled mode invoked: Storyboard.SetTargetProperty(anim, "(ZoneButton.ZoneButtonWidthProperty)"); Storyboard.SetTargetProperty(anim, "ZoneButtonWidth"); // doesn't throw exception but doesn't change width either. Doesn't seem to call setter Filled.Storyboard.Children.Add(anim); */ i++; } Zone_Clear(); // disables SendButton too }
/// <summary> /// Invoked when image add button is clicked and choose the image. /// </summary> /// <param name="sender">The image add button clicked.</param> /// <param name="e">Event data that describes how the click was initiated.</param> private async void ImageUploadButton_Click(object sender, RoutedEventArgs e) { FileOpenPicker picker = FileTypePicker(imagesFilterTypeList); if (picker == null) return; images = await picker.PickMultipleFilesAsync(); if (images == null || images.Count == 0) return; Image imgImg = new Image { Source = new BitmapImage(new Uri("ms-appx:///Images/Upload/image.png")), Margin = new Thickness(5, 0, 5, 0) }; ToolTip toolTip = new ToolTip(); toolTip.Content = images[0].Name; ToolTipService.SetToolTip(imgImg, toolTip); totalImagePanel.Children.RemoveAt(totalImagePanel.Children.Count - 1); imagePanel.Children.Add(imgImg); List<BackgroundTransferContentPart> imageParts = CreateBackgroundTransferContentPartList(images); Uri uploadUri = new Uri(Constants.DataCenterURI + "Upload.aspx?username="******"Image uplaod error3. Please check your network."); } }
private async void OnLoaded(object sender, RoutedEventArgs e) { Geolocator locator = new Geolocator(); Geoposition pos = await locator.GetGeopositionAsync(); #if WINDOWS_PHONE_APP MapControl yourLocationMap = new MapControl(); yourLocationMap.ZoomLevel = 16; yourLocationMap.Center = pos.Coordinate.Point; yourLocationMap.LandmarksVisible = true; /* * Un-comment this code to add an Icon MapIcon myIcon = new MapIcon(); myIcon.Location = pos.Coordinate.Point; myIcon.NormalizedAnchorPoint = new Point(0.70, 0.5); myIcon.Title = "You are here"; myIcon.Image = RandomAccessStreamReference.CreateFromUri( new Uri("ms-appx:///Assets/badge24.png")); yourLocationMap.MapElements.Add(myIcon); */ Ellipse ellipse = new Ellipse(); ellipse.Tapped += this.PushpinTapped; ellipse.Height = 36; ellipse.Width = 36; ellipse.StrokeThickness = 18; ellipse.Resources["Color"] = "Black"; ellipse.Stroke = new SolidColorBrush(Colors.Black); yourLocationMap.Children.Add(ellipse); MapControl.SetLocation(ellipse, pos.Coordinate.Point); MapControl.SetNormalizedAnchorPoint(ellipse, new Point(1.0, 0.5)); MapControl.SetLocation(yourLocationMap, pos.Coordinate.Point); this.mapBorder.Child = yourLocationMap; #endif #if WINDOWS_APP Map yourLocationMap = new Map(); yourLocationMap.Credentials = "Akh_f3lS3qEcqtwsJNaTCL_pTm1uaVTy4Nl4-9Ixeelyo9qo2DWn8adW4xcA_VIl"; yourLocationMap.ZoomLevel = 16; Location loc = new Location( pos.Coordinate.Point.Position.Latitude, pos.Coordinate.Point.Position.Longitude); yourLocationMap.Center = loc; Pushpin pin = new Pushpin(); pin.Tapped += this.PushpinTapped; pin.Resources["Color"] = "Black"; pin.Background = new SolidColorBrush(Colors.Black); ToolTip tt = new ToolTip(); tt.Content = "Ouch, please move your mouse."; ToolTipService.SetToolTip(pin, tt); Double lat = Convert.ToDouble(pos.Coordinate.Point.Position.Latitude); Double lng = Convert.ToDouble(pos.Coordinate.Point.Position.Longitude); Location lo = new Location(lat, lng); MapLayer.SetPosition(pin, lo); yourLocationMap.Children.Add(pin); this.mapBorder.Child = yourLocationMap; #endif }
/// <summary> /// Add lesson info to page after uploading button clicked. /// </summary> private void AddLessonInfo() { TextBlock newLessonName = new TextBlock { Text = lessonCount + ". " + lessonName.Text, FontSize = 50, Height = 70, Margin = new Thickness(5, 0, 0, 0), Foreground = new SolidColorBrush(Colors.White) }; StackPanel newLessonRes = new StackPanel { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right }; if (docs != null) { for (int i = 0; i < docs.Count; ++i) { Image docImg = new Image { Source = new BitmapImage(new Uri("ms-appx:///Images/Upload/doc.png")), Height = 70, Width = 35, Margin = new Thickness(2, 0, 2, 0), HorizontalAlignment = HorizontalAlignment.Right }; newLessonRes.Children.Add(docImg); ToolTip toolTip = new ToolTip(); toolTip.Content = docs[i].Name; ToolTipService.SetToolTip(docImg, toolTip); } } if (audios != null) { for (int i = 0; i < audios.Count; ++i) { Image audioImg = new Image { Source = new BitmapImage(new Uri("ms-appx:///Images/Upload/audio.png")), Height = 70, Width = 35, Margin = new Thickness(2, 0, 2, 0), HorizontalAlignment = HorizontalAlignment.Right }; newLessonRes.Children.Add(audioImg); ToolTip toolTip = new ToolTip(); toolTip.Content = audios[i].Name; ToolTipService.SetToolTip(audioImg, toolTip); } } if (videos != null) { for (int i = 0; i < videos.Count; ++i) { Image videoImg = new Image { Source = new BitmapImage(new Uri("ms-appx:///Images/Upload/video.png")), Height = 70, Width = 35, Margin = new Thickness(2, 0, 2, 0), HorizontalAlignment = HorizontalAlignment.Right }; newLessonRes.Children.Add(videoImg); ToolTip toolTip = new ToolTip(); toolTip.Content = videos[i].Name; ToolTipService.SetToolTip(videoImg, toolTip); } } lessonInfo.Children.Add(newLessonName); lessonRes.Children.Add(newLessonRes); }
void piece_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { ToolTip tooltip = null; PieDataPoint piece = (PieDataPoint)sender; Grid parent = (Grid)this.Parent; if (!piece.Pushedout) { if (piePieces.Selected != null) { tooltip = (ToolTip)parent.FindName("ToolTip"+piePieces.Selected.Data.ID.ToString()); if (tooltip != null) { tooltip.HideData(); } piePieces.Selected.InAnimation(); piePieces.Selected.Pushedout = false; } piePieces.Selected = piece; piece.OutAnimation(); piece.Pushedout = true; tooltip = new ToolTip(); tooltip.ParentGrid = parent; tooltip.Name = "ToolTip" + piece.Data.ID.ToString(); try { parent.Children.Add(tooltip); } catch { } Grid.SetColumn(tooltip, 0); Grid.SetColumnSpan(tooltip, 2); tooltip.Margin = new Thickness(0); tooltip.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Bottom; tooltip.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Right; tooltip.ViewData(piece.Data); piePieces.Selected = piece; if(ItemSelected != null) { ItemSelected(piece, piece.Data); } } else { tooltip = (ToolTip)parent.FindName("ToolTip"+piece.Data.ID.ToString()); if (tooltip != null) { tooltip.HideData(); } piece.InAnimation(); piece.Pushedout = false; piePieces.Selected = null; if (ItemDeSelected != null) { ItemDeSelected(piece, piece.Data); } } }
private void updatedetail(FullFileDetailsMessage detail) { this.Dispatcher.RunAsync(CoreDispatcherPriority.High, new DispatchedHandler(() => { SongDetails.Update(CurrentSong, detail.BitRate, detail.Size, detail.MusicType); ToolTip t1 = new ToolTip(); t1.Content = SongDetails.MainKey; ToolTipService.SetToolTip(CurrentSongMainKey, t1); ToolTip t2 = new ToolTip(); t2.Content = SongDetails.Album; ToolTipService.SetToolTip(CurrentSongAlbum, t2); ToolTip t3 = new ToolTip(); t3.Content = SongDetails.Title; ToolTipService.SetToolTip(CurrentSongTitle, t3); })); }
public void SetToolTip(ToolTip t) { ToolTipService.SetToolTip(button, t); }
protected override void OnPointerEntered(Windows.UI.Xaml.Input.PointerRoutedEventArgs e) { ToolTip toolTip = new ToolTip(); toolTip.Content = this.ToString(); toolTip.Placement = Windows.UI.Xaml.Controls.Primitives.PlacementMode.Mouse; ToolTipService.SetToolTip(this, toolTip); toolTip.IsOpen = true; if (!this.Searched && !this.Selected) { treemapRect.Stroke = new SolidColorBrush(Colors.Yellow); treemapRect.StrokeThickness = 1; } }
private void SetupColumnHeadings() { _cellWidth = _screenWidth / this.Columns.Length; for (int i = 0; i < this.Columns.Length; i++) { ListViewItem item = new ListViewItem(); item.Margin = new Thickness(0); item.Padding = new Thickness(0); item.Width = _cellWidth; item.HorizontalContentAlignment = Windows.UI.Xaml.HorizontalAlignment.Center; item.Content = _datasetModel.ColumnHeadings[_columnIndexes[i]]; item.PointerPressed += columnHeading_PointerPressed; ToolTip tt = new ToolTip(); tt.Content = _datasetModel.ColumnHeadings[_columnIndexes[i]]; tt.Placement = Windows.UI.Xaml.Controls.Primitives.PlacementMode.Mouse; ToolTipService.SetToolTip(item, tt); _columnHeadingsListViewItems.Add(item); } // offset the position of the headings ListView to position over the cells correctly columnHeadingsListView.Margin = new Thickness(FIRST_ROW_WIDTH, 0, 0, 0); columnHeadingsListView.ItemsSource = _columnHeadingsListViewItems; _columnHeadingsListViewItems.CollectionChanged += columnHeadingsListViewItems_CollectionChanged; Draw(); }