Ejemplo n.º 1
0
 public PrecisePopupCandidate(PrecisePopupModel popup, PrecisePopupPlacementModel placement, bool max = false)
 {
     Popup     = popup;
     Placement = placement;
     IsMaxSize = max;
     if (!IsMaxSize)
     {
         Extreme = new PrecisePopupCandidate(popup, placement, true);
     }
 }
Ejemplo n.º 2
0
 internal PrecisePopupWindow(PrecisePopupModel model)
 {
     Model          = model;
     DataContext    = FacadeModel.Wrap(Model);
     Width          = 0;
     Height         = 0;
     PositioningJob = new ComputedJob(() =>
     {
         Console.WriteLine("Placing window at ({0},{1})", Model.SelectedCandidate.X, Model.SelectedCandidate.Y);
         Left = Model.SelectedCandidate.X;
         Top  = Model.SelectedCandidate.Y;
         Console.WriteLine("Max window size set to {0}x{1}", Model.SelectedCandidate.MaxWidth, Model.SelectedCandidate.MaxHeight);
         MaxWidth      = Model.SelectedCandidate.MaxWidth;
         MaxHeight     = Model.SelectedCandidate.MaxHeight;
         SizeToContent = SizeToContent.WidthAndHeight;
         Model.PopupControl.UpdateSelectedPlacement();
     });
     PositioningJob.Start();
     Loaded += (s, args) => Mouse.Capture(this, CaptureMode.SubTree);
 }
Ejemplo n.º 3
0
 public PrecisePopup()
 {
     Model      = new PrecisePopupModel(this);
     Placements = new PrecisePopupPlacementCollection();
     FacadeModel.UpdateAll(Model, this);
 }