示例#1
0
        public GalleryViewModel()
        {
            var home = new Home.HomeViewModel();

            GalleryItems.Add(home);

            var controlItems = new ControlsViewModel();

            GalleryItems.Add(controlItems);

            var converters = new ConvertersViewModel();

            GalleryItems.Add(converters);

            var popupItems = new PopupsViewModel();

            GalleryItems.Add(popupItems);

            var behaviourItems = new BehavioursViewModel();

            GalleryItems.Add(behaviourItems);

            var dragAndDropItems = new DragAndDropViewModel();

            GalleryItems.Add(dragAndDropItems);

            var mvvmItems = new MVVMViewModel();

            GalleryItems.Add(mvvmItems);

            SelectedGalleryItem = home;
        }
示例#2
0
        public PopupsViewModel()
        {
            Title = "Popups";

            GalleryItems.Add(new SimplePopupViewModel());
            GalleryItems.Add(new CustomisedPopupViewModel());
        }
示例#3
0
        public DragAndDropViewModel()
        {
            Title = "Drag & Drop";

            GalleryItems.Add(new CanvasSampleViewModel());
            GalleryItems.Add(new ItemsControlSampleViewModel());
        }
示例#4
0
        private async Task LoadImagesAsync()
        {
            int imagesCount = 0;

            if (Images != null)
            {
                imagesCount = Images.Count;
            }

            Images = await Api.GetImagesAsync(EntryId);

            if (Log.IsDebugEnabled())
            {
                Log.Debug($"LoadImages, previous images: {imagesCount}, markers: {Markers.Count}, entry locations: {Model.Locations.Count}.");
                Log.Debug(Json.Serialize(Markers));
            }

            if (imagesCount > 0)
            {
                Markers.RemoveRange(0, imagesCount);
            }

            if (Log.IsDebugEnabled())
            {
                Log.Debug($"LoadImages.Cleared, markers: {Markers.Count}.");
                Log.Debug(Json.Serialize(Markers));
            }

            for (int i = 0; i < Images.Count; i++)
            {
                var image = Images[i];

                Markers.Insert(i, new MapMarkerModel
                {
                    Latitude  = image.Location.Latitude,
                    Longitude = image.Location.Longitude,
                    Altitude  = image.Location.Altitude,
                    DropColor = "blue",
                    Title     = image.Name
                });
            }

            if (Log.IsDebugEnabled())
            {
                Log.Debug($"LoadImages.Final, markers: {Markers.Count}.");
                Log.Debug(Json.Serialize(Markers));
            }

            GalleryItems.Clear();
            foreach (var image in Images)
            {
                GalleryItems.Add(new GalleryModel()
                {
                    Title  = image.Name,
                    Width  = image.Preview.Width,
                    Height = image.Preview.Height
                });
            }
        }
示例#5
0
        public MVVMViewModel()
        {
            Title = "MVVM";

            GalleryItems.Add(new SimpleExampleViewModel());
            GalleryItems.Add(new CommandingSampleViewModel());
            GalleryItems.Add(new ViewBrokerSampleViewModel());
            GalleryItems.Add(new ViewBrokerActivationSampleViewModel());
        }
示例#6
0
        public ControlsViewModel()
        {
            Title = "Controls";

            GalleryItems.Add(new ApexGridViewModel());
            GalleryItems.Add(new CrossButtonViewModel());
            GalleryItems.Add(new CueTextBoxViewModel());
            GalleryItems.Add(new EnumComboBoxViewModel());
            GalleryItems.Add(new ImageButtonViewModel());
            GalleryItems.Add(new ImageCheckBoxViewModel());
            GalleryItems.Add(new PaddedGridViewModel());
            GalleryItems.Add(new SearchTextBoxViewModel());
            GalleryItems.Add(new SelectableItemsControlViewModel());
        }
示例#7
0
        /// <summary>
        /// Extracts all nodes from node definitions and loads them into galleries.
        /// </summary>
        private void LoadGalleryItems()
        {
            var categories = NodeDefinitions.OrderBy(x => x.Category).GroupBy(x => x.Category);

            foreach (var category in categories)
            {
                var gallery = new Gallery()
                {
                    Header = category.Key
                };

                if (string.IsNullOrEmpty(gallery.Header))
                {
                    gallery.Header = "General";
                }

                foreach (var item in category.OrderBy(x => x.DisplayName))
                {
                    var galleryItem = new GalleryItem {
                        Header = item.DisplayName
                    };

                    if (item is Definition.ActionNodeDefinition)
                    {
                        galleryItem.Shape = new ActionNodeShape
                        {
                            Name        = item.Name,
                            DataContext = item,
                        };
                    }
                    else
                    {
                        galleryItem.Shape = new EventNodeShape
                        {
                            Name        = item.Name,
                            DataContext = item,
                        };
                    }

                    gallery.Items.Add(galleryItem);
                }
                GalleryItems.Add(gallery);
                GalleryViewSources[gallery]        = CollectionViewSource.GetDefaultView(gallery.Items);
                GalleryViewSources[gallery].Filter = nodeFilter;
            }

            SelectedGallery = GalleryItems.FirstOrDefault();
        }
示例#8
0
        public ControlsViewModel()
        {
            Title = "Controls";

            GalleryItems.Add(new ApexGridViewModel());
            GalleryItems.Add(new CrossButtonViewModel());
            GalleryItems.Add(new CueTextBoxViewModel());
            GalleryItems.Add(new EnumComboBoxViewModel());
            GalleryItems.Add(new FolderTextBoxViewModel());
            GalleryItems.Add(new ImageButtonViewModel());
            GalleryItems.Add(new ImageCheckBoxViewModel());
            GalleryItems.Add(new MultiBorderViewModel());
            GalleryItems.Add(new PaddedGridViewModel());
            GalleryItems.Add(new PathTextBoxViewModel());
            GalleryItems.Add(new PivotControlViewModel());
            GalleryItems.Add(new SearchTextBoxViewModel());
            GalleryItems.Add(new SelectableItemsControlViewModel());
            GalleryItems.Add(new TabbedDocumentInterfaceViewModel());
        }
示例#9
0
        public GalleryViewModel()
        {
            var homeItem = new Home.HomeViewModel();

            GalleryItems.Add(homeItem);

            var controlItems = new ControlsViewModel();

            GalleryItems.Add(controlItems);

            var popupItems = new GalleryItemViewModel()
            {
                Title = "Popups"
            };

            popupItems.GalleryItems.Add(new PopupsViewModel());
            GalleryItems.Add(popupItems);

            //var behaviourItems = new GalleryItemViewModel() {Title = "Behaviours"};
            //behaviourItems.GalleryItems.Add(new ListViewItemContextMenuBehaviourViewModel());
            //GalleryItems.Add(behaviourItems);

            var dragAndDropItems = new GalleryItemViewModel()
            {
                Title = "Drag and Drop"
            };

            dragAndDropItems.GalleryItems.Add(new CanvasSampleViewModel());
            dragAndDropItems.GalleryItems.Add(new ItemsControlSampleViewModel());
            GalleryItems.Add(dragAndDropItems);

            var mvvmItems = new GalleryItemViewModel()
            {
                Title = "MVVM"
            };

            mvvmItems.GalleryItems.Add(new SimpleExampleViewModel());
            mvvmItems.GalleryItems.Add(new CommandingSampleViewModel());
            mvvmItems.GalleryItems.Add(new ViewBrokerSampleViewModel());
            mvvmItems.GalleryItems.Add(new ViewBrokerActivationSampleViewModel());
            GalleryItems.Add(mvvmItems);
        }
示例#10
0
        public BehavioursViewModel()
        {
            Title = "Behaviours";

            GalleryItems.Add(new ListViewItemContextMenuBehaviourViewModel());
        }