Exemple #1
0
        public void StopMouseDown()
        {
            if (GuidelineOriginal == false && ParentDock.GuidelineWhenMove)
            {
                ParentDock.Guideline = false;
            }

            if (PositionError)
            {
                if (NowLoading)
                {
                    ParentDock.Remove(this);
                }
                else
                {
                    SetPosition(LastRow, LastColumn, true);
                    GridError.Visibility = Visibility.Collapsed;
                }
            }
            else
            {
                LastRow    = Row;
                LastColumn = Column;
                SetPosition(Row, Column, true);
                ParentDock.Config.SaveWidgets();
            }

            GridSelect.Visibility = Visibility.Collapsed;
            ReleaseMouseCapture();
        }
Exemple #2
0
        private void GridWidget_LongClick()
        {
            AlertDialog Dialog = new AlertDialog(Application.Current.MainWindow,
                                                 "선택된 위젯 삭제",
                                                 "선택한 위젯을 삭제하시겠습니까? 삭제한 위젯은 애플리케이션의 위젯 서랍에서 다시 불러올 수 있습니다.",
                                                 true);

            Dialog.ShowDialog();
            LongClick = false;
            if (Dialog.GetResult())
            {
                ParentDock.Remove(this);
            }
        }
Exemple #3
0
        private void GridWidget_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (!Expand)
            {
                if (LongClickTimer != null)
                {
                    LongClickTimer.Stop();
                    LongClickTimer = null;
                }

                if (!LongClick)
                {
                    if (!NowLoading)
                    {
                        Expand = true;
                    }
                    else
                    {
                        StopMouseDown();
                        NowLoading = false;

                        if (LazyLoading != null)
                        {
                            if (Load(LazyLoading, true))
                            {
                                ImgLoading.Visibility = Visibility.Collapsed;
                            }
                            else if (ParentDock != null)
                            {
                                ParentDock.Remove(this);

                                AlertDialog Dialog = new AlertDialog(Application.Current.MainWindow,
                                                                     "오류",
                                                                     "위젯을 로드할 수 없습니다.\n" +
                                                                     "어셈블리 오류가 발생하였습니다.",
                                                                     false);

                                Dialog.ShowDialog();
                            }
                        }
                    }
                }
                else
                {
                    LongClick = false;
                }
            }
        }
Exemple #4
0
        public void StartMouseDown(MouseButtonEventArgs e = null)
        {
            GuidelineOriginal = ParentDock.Guideline;
            if (ParentDock.GuidelineWhenMove)
            {
                ParentDock.Guideline = true;
            }

            ParentDock.BringToFront(this);
            GridSelect.Visibility = Visibility.Visible;
            if (e != null)
            {
                LocalPosition = e.GetPosition(this);
            }
            CaptureMouse();
        }