Example #1
0
        }//左键选择,暂时取消

        private async void GridView_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            var           Info          = (e.OriginalSource as FrameworkElement)?.DataContext as ViewDevModel;
            DeviceModel   DataInfo      = ModelConverter.ViewToData(Info);
            ContentDialog detail_dialog = new ContentDialog()
            {
                Title               = DataInfo.Type + "设备详情:",
                Content             = "设备地址:" + DataInfo.IPAddress + ":" + DataInfo.NetPort,
                PrimaryButtonText   = "发送命令",
                SecondaryButtonText = "删除设备",
                CloseButtonText     = "返回",
                FullSizeDesired     = true,
            };
            ContentDialogResult Reslut = await detail_dialog.ShowAsync();

            if (Reslut == ContentDialogResult.Primary)
            {
                if (DataInfo.IPAddress == "Zigbee设备")//关闭串口服务
                {
                    WriteCmdByte(new byte[] { 0x02 });
                    //SendCmd(Convert.ToInt16("9003"), "0000+B");
                }
                else
                {
                    if (FanFlag == false)
                    {
                        SendCmd(Convert.ToInt16(DataInfo.NetPort), "0000+A");
                        FanFlag = true;
                    }
                    else
                    {
                        SendCmd(Convert.ToInt16(DataInfo.NetPort), "0000+B");
                        FanFlag = false;
                    }
                }
                //SendCmd(DataInfo.NetPort, "这是一条测试信息/");
            }
            if (Reslut == ContentDialogResult.Secondary)
            {
                if (DataInfo.IPAddress == "Zigbee设备")//关闭串口服务
                {
                    try
                    {
                        CancelReadTask();
                        CloseDevice();
                        ListAvailablePorts();
                    }
                    catch (Exception)
                    { }
                    btnAddZigBee.IsEnabled = true;
                }
                DisposeLine(DataInfo.NetPort);//移除监听服务
                for (int i = 0; i < Obj.Count; i++)
                {
                    if (Obj[i].NetPort == DataInfo.NetPort)
                    {
                        Obj.Remove(Obj[i]);
                    }
                }
                gridView.Items.Remove(Info);
                DevicesMethod.UpdateDevices(Obj);
            }
        }//右键选择
Example #2
0
 private void paginaReceita_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     lateralMenu.Visibility = lateralMenu.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
 }
Example #3
0
 private void RightTap_Rotate(object sender, RightTappedRoutedEventArgs e)
 {
     Data.Rotation(sender, e);
 }
 private void FamilyList_RightTap(object sender, RightTappedRoutedEventArgs e)
 {
     FamilyListMethod(e.OriginalSource as Image);
 }
Example #5
0
 private void test(object sender, RightTappedRoutedEventArgs e)
 {
     Process.Start(e.Handled.ToString());
 }
 private void UIElement_OnRightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     ImageSaveFlyout.ShowAt(sender as FrameworkElement);
 }
 /// <summary>
 /// Selects the tapped order.
 /// </summary>
 private void DataGrid_RightTapped(object sender, RightTappedRoutedEventArgs e) =>
 ViewModel.SelectedOrder = (e.OriginalSource as FrameworkElement).DataContext as Order;
Example #8
0
 private void StackPanel_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     this.itemFlyout.ShowAt((UIElement)sender, e.GetPosition((UIElement)sender));
 }
 private void StatusLabel_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(StatusLabel);
     e.Handled = true;
 }
 public void AgendaDate_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     SelectedAgendaDate = ((FrameworkElement)e.OriginalSource).DataContext as AgendaDates;
     FillAgendaItemByAgendaDate(SelectedAgendaDate);
 }
Example #11
0
 private void ConnectionItemWrapper_OnRightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
 }
Example #12
0
 private void _img_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     // Todo:增加图片另存为功能
 }
Example #13
0
 private void CommunityItemPhotoImage_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     Debug.WriteLine("RightTapped");
     savePic();
 }
Example #14
0
 private void UserControl_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
 }
 private void NotebookPanel_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(sender as FrameworkElement);
 }
 private void YearLabel_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(YearFiltersMenuTextBlock);
     e.Handled = true;
 }
Example #17
0
        private void OpenBackgroundFlyout(object sender, RightTappedRoutedEventArgs e)
        {
            var s = (FrameworkElement)sender;

            BackgroundFlyout.ShowAt(s, e.GetPosition(s));
        }
 private void BindableGridControl_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     e.Handled = true;
     m_ViewModel.IsMultipleSelect = !m_ViewModel.IsMultipleSelect;
 }
Example #19
0
 void OnOpenContext(object sender, RightTappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(CellContent);
 }
 private void Grid_RightTapped(object sender, RightTappedRoutedEventArgs e) => FlyoutBase.ShowAttachedFlyout(sender as FrameworkElement);
 //show the context menu if right mouse is pressed
 private void MainWeb_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     MainWeb.ContextFlyout.ShowAt(sender as FrameworkElement);
 }
 private void VisualStateAwarePage_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     TopAppBarShowValidationSummary.Visibility = Visibility.Collapsed;
 }
Example #23
0
 private void StaffList_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     ResetStatus();
 }
Example #24
0
 void maps_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     AddMark(c1Maps1.ScreenToGeographic(e.GetPosition(c1Maps1)));
 }
Example #25
0
 protected override void OnRightTapped(RightTappedRoutedEventArgs e)
 {
     base.OnRightTapped(e);
     Show();
 }
Example #26
0
 private void lstAllGames_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
 }
Example #27
0
        private void PlaceholderInteractionGrid_OnRightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            var grid = sender as UIElement;

            VideoFlyout.ShowAt(grid, e.GetPosition(grid));
        }
Example #28
0
 private void TimeEntryRightClicked(object sender, RightTappedRoutedEventArgs e)
 {
     Console.WriteLine(sender as DataGridTextColumn);
 }
Example #29
0
 private void Border_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     ShowMenu(sender as Border);
 }
Example #30
0
        private void ImageClickR(object sender, RightTappedRoutedEventArgs e)
        {
            Button btn = (Button)sender;

            selectedImage = (int)btn.Tag;
        }