Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    advapiIT
    @advapiIT
    If I need to load some module of my application using Orc, have I to use Prism? right now I search for the file name and perform an Assembly.Load
    but since I'm heavily putting hands on I wish to enhance the code
    Geert van Horrik
    @GeertvanHorrik
    check orc.extensibility
    advapiIT
    @advapiIT
    Thanks!
    advapiIT
    @advapiIT
    excuse me but have I to register the CommandContainer or are they somehow registered? I've tried to look at orchestra code for ApplicationAboutCommandContainer but it doesn't seem to be refenced
    Geert van Horrik
    @GeertvanHorrik
    I believe there is an extension method on the CommandManager for that
    advapiIT
    @advapiIT
    to auto register?
    advapiIT
    @advapiIT
    I've done so far in my app.xaml.cs
       private void RegisterCommands()
            {
                var dependencyResolver = this.GetDependencyResolver();
    
                // Registered as command
                var commandManager = dependencyResolver.Resolve<ICommandManager>();
                commandManager.CreateCommandWithGesture(typeof(ExitCommandContainer), Commands.Application.Exit);
            }
     public class ExitCommandContainer : CommandContainerBase
        {
          //  private readonly ICloseApplicationService closeApplicationService;
            public ExitCommandContainer(string commandName, ICommandManager commandManager/*, ICloseApplicationService closeApplicationService*/) : base(Commands.Application.Exit, commandManager)
            {
              //  Argument.IsNotNull(()=>closeApplicationService);
              //  this.closeApplicationService = closeApplicationService;
            }
    
            protected override void Execute(object parameter)
            {
               // closeApplicationService.Close();
            }
        }
     public static class Commands
        {
            public static class Application
            {
                public const string Exit = "Exit";
            }
        }
    image.png
    Geert van Horrik
    @GeertvanHorrik
    you need to call commandManager.CreateCommandWithGesture(typeof(Commands.Application), Commands.Application.Exit);
    advapiIT
    @advapiIT
    I've fixed it but I still got some problem, first the ExitCommanandContainer s constructor is never called
    second *but I think it's a consequence I got the Menu item disabled
     private Task AddFileMenu()
            {
                return Task.Factory.StartNew(() =>
                {
                    MenuItemNode menuItemNode = new MenuItemNode { Text = "File" };
    
                    using (menuItemNode.Children.SuspendChangeNotifications())
                    {
                        var command = commandManager.GetCommand(Commands.Commands.Exit);
                        menuItemNode.Children.Add(new MenuItemNode { Text = "Exit", Command = command });
                    }
    
                    using (menu.Menus.SuspendChangeNotifications())
                        menu.Menus.Insert(0, menuItemNode);
                });
            }
    advapiIT
    @advapiIT
    I got 11:35:38:887 => [DEBUG] [Catel.ICommandManagerExtensions] [1] Found command container 'IF.Tesoreria.Client.WPF.Infrastructure.Commands.ExitCommandContainer', registering it in the ServiceLocator now 11:35:38:888 => [DEBUG] [Catel.IoC.TypeFactory] [1] Creating instance of type 'IF.Tesoreria.Client.WPF.Infrastructure.Commands.ExitCommandContainer' using specific parameters. No constructor found in the cache, so searching for the right one 11:35:38:888 => [DEBUG] [Catel.IoC.TypeFactory] [1] Checking if constructor 'public ctor(String commandName, ICommandManager commandManager)' can be used 11:35:38:888 => [DEBUG] [Catel.IoC.TypeFactory] [1] Constructor is not valid because parameter 'commandName' cannot be resolved from the dependency resolver
    advapiIT
    @advapiIT
    resolved, I had to remove the string commandName, in the ExitCommandContainer
    advapiIT
    @advapiIT
    I've almost integrated orchestra with a lot of satisfaction!
    advapiIT
    @advapiIT
    just another question, I've added a CommandBinding for the exit, before I was hosting the ShellViewModel inside my app and had an event on the Cancel that performs the question, do I-ve to move that logic inside the Ribbon's assembly?
    advapiIT
    @advapiIT
    Good morning, I was trying to integrate the Orc.Extensibility, in this link https://github.com/WildGums/Orc.Extensibility/blob/develop/src/Orc.Extensibility.Example/Orc.Extensibility.Example/App.xaml.cs you say // In an Orchestra environment, this would go into the bootstrapper
    but right now I'm not using the bootstrapper, I do on the app.xaml.cs
        var shellService = serviceLocator.ResolveType<IShellService>();
    
        shellService.CreateWithSplashAsync<ShellWindow>();
    Geert van Horrik
    @GeertvanHorrik
    I believe the shell service calls IApplicationInitializationService
    you can load your plugins there
    venom_aa
    @venomAA
    yup..it does. I have been using it to register a lot of stuff there
    advapiIT
    @advapiIT
    erm I've a strange problem, after having integrated orc, I don't see in the toolbar the icon of the app anymore...was I wrong or there was a property to set....something as ShowInToolbar?
    Geert van Horrik
    @GeertvanHorrik
    you should set it as app icon in your project
    could be that it does not display in debug mode
    try release as well
    advapiIT
    @advapiIT
    nono it's a Telerik non feature...reading their post I've to do something as
      var window = this.ParentOfType<Window>();
                window.ShowInTaskbar = true;
                var serviceLocator = ServiceLocator.Default;
    since RadWindow itself doesn't have that prop
    advapiIT
    @advapiIT
    ok I'm on it....after having looked as a dumb for days, I've found that there's a telerik helper to do so, for sack of knowledge RadWindowInteropHelper.SetShowInTaskbar(this,true);
    and that must be put inside the Window constructor
    ```
    public Window(IViewModel viewModel)
    {
    _logic = new WindowLogic(this, null, viewModel);
    _logic.ViewModelChanged += (sender, e) => ViewModelChanged.SafeInvoke(this, e);
    _logic.PropertyChanged += (sender, e) => PropertyChanged.SafeInvoke(this, e);
            Loaded += (sender, e) => _viewLoaded.SafeInvoke(this);
            Unloaded += (sender, e) => _viewUnloaded.SafeInvoke(this);
            DataContextChanged += (sender, e) => _viewDataContextChanged.SafeInvoke(this, new DataContextChangedEventArgs(e.OldValue, e.NewValue));
    
            // Because the RadWindow does not close when DialogResult is set, the following code is required
            ViewModelChanged += (sender, e) => OnViewModelChanged();
    
            // Call manually the first time (for injected view models)
            OnViewModelChanged();
    
            RadWindowInteropHelper.SetShowInTaskbar(this,true);
        }
    advapiIT
    @advapiIT
    excuse me when I reference the <views1:WorkspacesView Grid.Column="1" /> in the view
    it's viewmodel is istantiated internally? since even in the sample I don't see any workspaceviewmodel
    advapiIT
    @advapiIT
    the problem seems to be on public object Scope { get; set; }
    that-s passed to the ResolveType as a Tag
    advapiIT
    @advapiIT
    seems it to be passed as null
    Activating workspace manager using scope ''
    advapiIT
    @advapiIT
    if u can help me on this Geert, I'm almost done...can't understand why in the workspacesviewmodel you pass a scope
    Geert van Horrik
    @GeertvanHorrik
    Sorry, free time is up, I think I've helped you enough over the year
    advapiIT
    @advapiIT
    O_O
    so have I to pay?
    Geert van Horrik
    @GeertvanHorrik
    no, you don't have to, you can also check the source code, ask on stackoverflow in the hope someone else answers the question
    I have (paid) work to do as well, just as you, and I don't want to spend any more of my precious (limited & free) time on helping out for free, that's all
    But like I said before: if you are working for a company, just go to the manager and ask for a budget. Anyone (e.g. @venomAA) could help you out, as long as you pay them (which is nothing else then fair to be honest)
    venom_aa
    @venomAA
    @advapiIT you should totally download and play with the source code..will take you some time but that is how i got to understand the why and what could orchestra do and what i had to cheat out of it. In the long run that will help you more than getting help. What i did is copy directly orchestra code to my projects and debug it over with my changes and see what happened. Thats how i got to do the login thing and create my custom controls for coms and bluetooth.
    advapiIT
    @advapiIT
    excuse me, does orchestra have some sort of module that dumps system information? as ram, cpu etc?
    Geert van Horrik
    @GeertvanHorrik
    yup, see Orc.SystemInfo
    advapiIT
    @advapiIT
    Thnks