Ejemplo n.º 1
0
        protected override void AppearanceChanged()
        {
            base.AppearanceChanged();

            this.popover.Appearance = HostResources.GetVibrantAppearance(EffectiveAppearance);
            this.popover.ContentViewController.View.Appearance = EffectiveAppearance;
        }
Ejemplo n.º 2
0
        protected override void AppearanceChanged()
        {
            base.AppearanceChanged();

            XLabel.TextColor = HostResources.GetNamedColor(NamedResources.DescriptionLabelColor);
            YLabel.TextColor = HostResources.GetNamedColor(NamedResources.DescriptionLabelColor);
        }
        public override void ViewDidChangeEffectiveAppearance()
        {
            base.ViewDidChangeEffectiveAppearance();

            this.popover.SetAppearance(HostResources.GetVibrantAppearance(EffectiveAppearance));
            this.popover.ContentViewController.View.Appearance = EffectiveAppearance;
        }
        public override void ViewDidChangeEffectiveAppearance()
        {
            XLabel.TextColor      = HostResources.GetNamedColor(NamedResources.DescriptionLabelColor);
            YLabel.TextColor      = HostResources.GetNamedColor(NamedResources.DescriptionLabelColor);
            WidthLabel.TextColor  = HostResources.GetNamedColor(NamedResources.DescriptionLabelColor);
            HeightLabel.TextColor = HostResources.GetNamedColor(NamedResources.DescriptionLabelColor);

            base.ViewDidChangeEffectiveAppearance();
        }
Ejemplo n.º 5
0
 public override void ViewDidChangeEffectiveAppearance()
 {
     base.ViewDidChangeEffectiveAppearance();
     this.label.TextColor = HostResources.GetNamedColor(NamedResources.DescriptionLabelColor);
 }
Ejemplo n.º 6
0
        private void Initialize(PropertyViewModel propertyViewModel)
        {
            this.ShowPreview = true;
            TranslatesAutoresizingMaskIntoConstraints = false;

            var FrameWidthThird = Frame.Width / 3;
            var FrameWidthHalf  = Frame.Width / 2;
            var FrameHeightHalf = Frame.Height / 2;

            NSControlSize controlSize = NSControlSize.Small;

            this.searchResources = new NSSearchField {
                ControlSize       = controlSize,
                Font              = NSFont.SystemFontOfSize(NSFont.SystemFontSizeForControlSize(NSControlSize.Small)),
                PlaceholderString = Properties.Resources.SearchResourcesTitle,
                TranslatesAutoresizingMaskIntoConstraints = false,
            };

            this.searchResources.Changed += OnSearchResourcesChanged;

            AddSubview(this.searchResources);

            var vmType            = propertyViewModel.GetType();
            var valuePropertyInfo = vmType.GetProperty("Value");
            var resourceValue     = valuePropertyInfo.GetValue(propertyViewModel);

            this.resourceSelectorPanel = new RequestResourcePanel(HostResources, new ResourceSelectorViewModel(propertyViewModel.TargetPlatform.ResourceProvider, propertyViewModel.Editors.Select(ed => ed.Target), propertyViewModel.Property), resourceValue);
            this.resourceSelectorPanel.ResourceSelected += (sender, e) => {
                propertyViewModel.Resource = this.resourceSelectorPanel.SelectedResource;
            };
            this.resourceSelectorPanel.DoubleClicked += (sender, e) => {
                PopOver.Close();
            };

            AddSubview(this.resourceSelectorPanel);

            segmentedControl = NSSegmentedControl.FromLabels(new string[] { Properties.Resources.AllResources, Properties.Resources.Local, Properties.Resources.Shared }, NSSegmentSwitchTracking.SelectOne, () => {
                //Switch Resource Types
                switch (this.segmentedControl.SelectedSegment)
                {
                case 0:
                    this.resourceSelectorPanel.ViewModel.ShowBothResourceTypes = true;
                    this.segmentedControl.SetImage(HostResources.GetNamedImage("pe-resource-editor-16"), 2);
                    break;

                case 1:
                    this.resourceSelectorPanel.ViewModel.ShowOnlyLocalResources = true;
                    this.segmentedControl.SetImage(HostResources.GetNamedImage("pe-resource-editor-16"), 2);
                    break;

                case 2:
                    this.resourceSelectorPanel.ViewModel.ShowOnlySystemResources = true;
                    this.segmentedControl.SetImage(HostResources.GetNamedImage("pe-resource-editor-16~sel"), 2);
                    break;
                }

                this.resourceSelectorPanel.ReloadData();
            });
            this.segmentedControl.SetImage(HostResources.GetNamedImage("pe-resource-editor-16"), 2);
            this.segmentedControl.Frame = new CGRect((FrameWidthThird - (segmentedControl.Bounds.Width) / 2), 5, (Frame.Width - (FrameWidthThird)) - 10, 24);
            this.segmentedControl.Font  = NSFont.SystemFontOfSize(NSFont.SystemFontSizeForControlSize(NSControlSize.Small));
            this.segmentedControl.TranslatesAutoresizingMaskIntoConstraints = false;
            this.segmentedControl.SetSelected(true, 0);
            this.resourceSelectorPanel.ViewModel.ShowBothResourceTypes = true;

            AddSubview(this.segmentedControl);

            this.showPreviewImage = new NSButton {
                Bordered    = false,
                ControlSize = controlSize,
                Image       = NSImage.ImageNamed(NSImageName.QuickLookTemplate),
                Title       = string.Empty,
                TranslatesAutoresizingMaskIntoConstraints = false,
            };

            this.showPreviewImage.Activated += (o, e) => {
                ShowPreview = !ShowPreview;
                RepositionControls();
            };

            AddSubview(this.showPreviewImage);

            OnSearchResourcesChanged(null, null);

            RepositionControls();
        }