prism

How to Use Prism in a Vue Project(代码高亮显示插件)

北城余情 提交于 2020-01-10 03:39:37
Prism is a lightweight, robust, elegant syntax highlighting library. 👣 Steps Create a Vue project and install Prism and Vue Prism Component. npm i -g @vue/cli vue create vue-demo cd vue-demo npm i prismjs vue-prism-component Register Prism in src/main.js. import "prismjs" ; import "prismjs/themes/prism-funky.css" ; import "prismjs/components/prism-scss.min" ; import "prismjs/plugins/autolinker/prism-autolinker.min" ; import "prismjs/plugins/autolinker/prism-autolinker.css" ; import Prism from "vue-prism-component" ; Vue . component ( "prism" , Prism ) ; Use Prism, e.g. in src/views/prism.vue.

Prism MVVM - How to pass an IEventAggregator to my ViewModel

◇◆丶佛笑我妖孽 提交于 2020-01-07 04:14:13
问题 recently I started working with Prism in Silverlight. I want to use the EventAggregator to Subscribe and Publish events between two ViewModels. As I saw on some guides, the ViewModel's ctor should accept IEventAggregator as a parameter. I can't find out how to do this hence my View always wants to initialize the ViewModel with a parameterless ctor. My ViewModel ctor: MyViewModel(IEventAggregator eventAggregator) { // get the event.... } My View: <UserControl ....> <UserControl.Resources>

Can't navigate using Prism

不羁岁月 提交于 2020-01-06 20:17:22
问题 I can't get the navigation in Prism to work. When I click on the buttons to go to respective views, nothing happens. This is the Man View (Shell) XAML: <Window x:Class="MVVMPractice2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:prism="http://prismlibrary.com/" prism:ViewModelLocator.AutoWireViewModel="True" xmlns:Views="clr-namespace:MVVMPractice2.Views" Title="MainWindow" Height="350" Width="525">

Silverlight Prism Module Not Ready

允我心安 提交于 2020-01-06 06:49:33
问题 I'm building a Silverlight 4.0 application with Prism (a.k.a. Composite Application Guidance). I have two modules, both defined in my ModuleCatalog.xaml as WhenAvailable . My Application_OnStart instantiates my Bootstrapper and invokes it's Run() method. Well after my application is started and up and running (in fact, the user has to click a button in the UI), I then attempt to load the modules: foreach (ModuleInfo mi in moduleCatalog.Modules) ... Type moduleType = Type.GetType(mi.ModuleType

MVVM Conditional return navigation in Prism

核能气质少年 提交于 2020-01-06 05:16:04
问题 Here's the business problem I'm trying to solve: Start with pages: Menu -> Activity -> Connect. When the user navigates from Menu -> Activity, if there is a specific piece of hardware not connected, I want to immediately Navigate to the Connect page. When back button is pressed on Connect page and there is still no device connected, we navigate back to Acitivyt. But now I do not want Activity to navigate again to Connect (trapping them in a loop). Rather I want to navigate all the way back to

MVVM Conditional return navigation in Prism

筅森魡賤 提交于 2020-01-06 05:16:04
问题 Here's the business problem I'm trying to solve: Start with pages: Menu -> Activity -> Connect. When the user navigates from Menu -> Activity, if there is a specific piece of hardware not connected, I want to immediately Navigate to the Connect page. When back button is pressed on Connect page and there is still no device connected, we navigate back to Acitivyt. But now I do not want Activity to navigate again to Connect (trapping them in a loop). Rather I want to navigate all the way back to

'cannot be assigned to — is read only' yet has a setter?

﹥>﹥吖頭↗ 提交于 2020-01-04 03:15:24
问题 I'm getting a (to me) very weird looking argument exception. When calling this.MainViewModel.MyObject = new MyObject(..some parameters here..); , I get property or indexer 'IMainViewModel.MyObject' cannot be assigned to -- it is read only . I've been trying to find people with similar questions but everytime the answer is 'do you have a setter?'. Yes, I do have a setter. Yes, my property is public. I'm very confused as to why it is throwing a fit here. The property I'm trying to write to is;

Questions on MEF strategy and structure

那年仲夏 提交于 2020-01-03 17:31:06
问题 I am tasked with modularizing a C# app that is a rewrite of a very large Delphi app (the DB has 249 tables!). Business constraints proscribe a complete redesign for .NET and better overall architecture, so we are basically just incrementally rewriting module for module of the Delphi app in C#. Until finished, the suite will comprise a mixture of pending rewrites, and C# app modules I want to integrate using MEF. The app concerns itself with Time-and-Attendance and Access-Control, and has

Why would adding an **appSettings** section to App.config cause an error in WPF application?

回眸只為那壹抹淺笑 提交于 2020-01-03 16:45:58
问题 In my WPF application (Composite Application) I want to store a variable in the App.config file, but as soon as I add an appSettings section in App.config, it gives me this error: The type initializer for System.Windows.Application threw an exception. App.Config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="SmartFormMockDirectory" value="C:\test"/> </appSettings> <configSections> </configSections> <system.serviceModel> <bindings> <basicHttpBinding> <binding

Prism App Does Not Exit When Closed

匆匆过客 提交于 2020-01-03 15:35:18
问题 I am learning prism and I have hit a problem. I have made an app very similar to the one that Mike Taulty makes in is great tutoral about Prism. The biggest difference is that my app is a WPF app instead of Silverlight. I am finding that I have hit a problem though. When I close the main shell window, the app does not exit. The window goes a way, but the debugger is still active. I have tried looking for call stacks and such, but Visual Studio just tells me that it is "External Code". Any