Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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
    venom_aa
    @venomAA
    anyone has run into this error with showdialogasync??
    System.InvalidOperationException: This Visual is not connected to a PresentationSource.
    at System.Windows.Media.Visual.PointToScreen(Point point)
    at Microsoft.VisualStudio.DesignTools.WpfTap.WpfVisualTreeService.Adorners.AdornerLayerWindow.UpdatePlacement()
    at Microsoft.VisualStudio.DesignTools.WpfTap.WpfVisualTreeService.Adorners.AdornerLayerWindow.<UpdatePlacementAsync>b__77_0(Object obj)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
    BonaPrimeERP.exe Information: 0 : 14:01:26:813 => [INFO] [Orchestra.DotNetPatchHelper] [1] An unhandled exception occurred, checking if it is a known KB issue: This Visual is not connected to a PresentationSource.
    BonaPrimeERP.exe Information: 0 : 14:01:26:816 => [INFO] [Orchestra.DotNetPatchHelper] [1] Below is a list of the last first chance exceptions that occurred. It might provide more information to the issue.
    BonaPrimeERP.exe Information: 0 : 14:01:26:822 => [INFO] [Orchestra.DotNetPatchHelper] [1] ================================================================================================
    BonaPrimeERP.exe Information: 0 : 14:01:26:824 => [INFO] [Orchestra.DotNetPatchHelper] [1]
    BonaPrimeERP.exe Information: 0 : 14:01:26:827 => [INFO] [Orchestra.DotNetPatchHelper] [1] [ThreadAbortException] System.Threading.ThreadAbortException: Thread was being aborted.
    at MS.Win32.UnsafeNativeMethods.IntGetMessageW(MSG& msg, HandleRef hWnd, Int32 uMsgFilterMin, Int32 uMsgFilterMax)
    at MS.Win32.UnsafeNativeMethods.GetMessageW(MSG& msg, HandleRef hWnd, Int32 uMsgFilterMin, Int32 uMsgFilterMax)
    at System.Windows.Threading.Dispatcher.GetMessage(MSG& msg, IntPtr hwnd, Int32 minMessage, Int32 maxMessage)
    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
    at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
    at Catel.Windows.PleaseWaitWindow.WorkerThread(Object arg) in C:\CI_WS\Ws\97969\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET46\Windows\PleaseWaitWindow.xaml.cs:line 426
    BonaPrimeERP.exe Information: 0 : 14:01:26:829 => [INFO] [Orchestra.DotNetPatchHelper] [1]
    BonaPrimeERP.exe Information: 0 : 14:01:26:830 => [INFO] [Orchestra.DotNetPatchHelper] [1] ================================================================================================
    BonaPrimeERP.exe Information: 0 : 14:01:26:832 => [INFO] [Orchestra.DotNetPatchHelper] [1]
    BonaPrimeERP.exe Information: 0 : 14:01:26:835 => [INFO] [Orchestra.DotNetPatchHelper] [1] [ThreadAbortException] System.Threading.ThreadAbortException: Thread was being aborted.
    at Catel.Windows.PleaseWaitWindow.WorkerThread(Object arg) in C:\CI_WS\Ws\97969\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET46\Windows\PleaseWaitWindow.xaml.cs:line 431
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart(Object obj)
    BonaPrimeERP.exe Information: 0 : 14:01:26:837 => [INFO] [Orchestra.DotNetPatchHelper] [1]
    BonaPrimeERP.exe Information: 0 : 14:01:26:839 => [INFO] [Orchestra.DotNetPatchHelper] [1] ================================================================================================