private void LevelIndexProp_ValueChanged(INotifyProperty <int> prop, int newValue)
        {
            var d      = DataContext as LevelModuleVm;
            var entity = d.EntityAs <ModuleEntity>();

            var isChecked = entity.GetLevelViewCollapsed(d.CurrentLevelProp.Value?.OwnerVm?.ToString() ?? "");
            //collapseAllButton.IsChecked = isChecked;

            // Reset search when switching levels.
            //this.textBoxSearch.Text = string.Empty;
        }
Exemplo n.º 2
0
 public static INotifyProperty <T> Get <T>(this INotifyProperty <T> notifyProperty, ValueGet <T> valueGet)
 {
     notifyProperty.ValueGet = valueGet;
     return(notifyProperty);
 }
Exemplo n.º 3
0
 public static INotifyProperty <T> ConsiderValueEqualWhen <T>(this INotifyProperty <T> notifyProperty, CheckEquality <T> checkConsiderEqual)
 {
     notifyProperty.CheckConsiderEqual = checkConsiderEqual;
     return(notifyProperty);
 }
Exemplo n.º 4
0
 public static INotifyProperty <T> BeforePropertyChanged <T>(this INotifyProperty <T> notifyProperty, ValueSet <T> valueSetCallback)
 {
     notifyProperty.BeforePropertyChanged = valueSetCallback;
     return(notifyProperty);
 }
Exemplo n.º 5
0
 private void TrailProp_ValueChanged(INotifyProperty <string> prop, string newValue)
 {
     BackButtonVisibleProp.Value = Utility.HistoryInstancesCount > 1;
 }
Exemplo n.º 6
0
 private void BlazorBindProperty_ValueChanged(INotifyProperty <string> prop, string newValue)
 {
 }
Exemplo n.º 7
0
        protected override void OnEntityAssigned(INotifyProperty <SolutionEntity> prop, SolutionEntity newValue)
        {
            base.OnEntityAssigned(prop, newValue);

            if (newValue == null)
            {
                return;
            }

            var solutionEntity = newValue as SolutionEntity;

            if (solutionEntity?.ShowIntro == true)
            {
                // Show intro
                this.OverlayControlVisibleProp.Value = true;

                //TODO
            }

            //NavigationPanelVisibleProp.TakesFrom(newValue, nameof(SolutionEntity.Layout), (a, b) => (SolutionEntity.Layouts)b == SolutionEntity.Layouts.Default);
            //TabRowVisibleProp.TakesFrom(newValue, nameof(SolutionEntity.Layout), (a, b) => (SolutionEntity.Layouts)b != SolutionEntity.Layouts.Full2);

            // Load things only once we have the solution entity.
            //var tabHome = new HomePageVm();
            //AddTab(tabHome, false);


            // Auto load modules from classes.
            foreach (Type moduleEntityType in ReflectionHelper.Instance.GatherTypeChildrenTypesFromAssemblies(typeof(ModuleEntity), ReflectionHelper.Instance.AllAssemblies))
            {
                if (moduleEntityType.IsAbstract || moduleEntityType.IsClass == false)
                {
                    continue;
                }

                var profilesAttr = (AppProfilesAttribute[])moduleEntityType.GetCustomAttributes(typeof(AppProfilesAttribute), true);
                if (profilesAttr?.Length > 0 && solutionEntity.AppProfile != Orions.Infrastructure.Common.AppProfiles.All && profilesAttr.Any(it => it.Profile == solutionEntity.AppProfile) == false)
                {
                    solutionEntity.RemoteModuleEntityType(moduleEntityType);
                    continue;                     // Was marked with profiles attribute, but not compatible with this.
                }

                ModuleEntity moduleEntity = solutionEntity.ModulesArray.FirstOrDefault(it => it.GetType() == moduleEntityType);
                if (moduleEntity == null)
                {
                    moduleEntity = (ModuleEntity)solutionEntity.ObtainModuleEntity(moduleEntityType);
                }
            }

            // The starting priority is important, as we need to fire up connections etc. before the others.
            var modules = solutionEntity.ModulesArray.OrderByDescending(it => it.StartingPriority).ToArray();

            foreach (ModuleEntity moduleEntity in modules)
            {            // Existing modules.
                var module = TryObtainModuleVmByEntity(moduleEntity);
            }

            // Load things only once we have the solution entity.
            //var tabHome = new HomePageVm();
            //tabHome.ModuleVmProp.Value = Modules.OfType<HomeModuleVm>().FirstOrDefault();
            //tabHome.ModuleVmProp.Value.SolutionVmProp.Value = this;

            //AddTab(tabHome, false);
        }