GithubHelp home page GithubHelp logo

dlbst / webviewwpfvue Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 70 KB

Project showing possible interaction between Vue.JS web app and WPF app (using WebView2).

License: MIT License

C# 56.78% JavaScript 4.70% HTML 2.21% Vue 20.83% CSS 15.48%

webviewwpfvue's Introduction

WebViewWPFVue

Project showing possible interaction between Vue.JS web app and WPF app (using WebView2).

You can find more information about this project in this article.

Setup

There is no need to start vue app independently, since there is webview2 api used. If the app is not started via WPF app, there will be an error in web console.

You have to first build the web app, using following commands (e.g. in vs code terminal).

npm install
npm run build

The app should be build and dist folder should be correctly mapped in WebView. Then build the WPF project and you can try the functionality. If the Vue app is not loaded, go to WebViewInitializationBehavior in WPF project and change the folder path of virtual host.

Projects

Repo consists of two projects - WPF app (WebViewWPFVue folder) and Vue app (vueproject folder). These two apps communicate between each other via WebView2 API. They just simply exchange JSON. In Vue app, you can find the Toast Notification component in ToastNotification.vue and the Computer Info component in ComputerInfo.vue. In WPF app you can see the main logic in MainWindow.xaml, where the WebView is declared, in MainWindowViewModel.cs and in WebViewPostMessageBehavior.cs. The WebView initialization was put to WebViewInitializationBehavior.

webviewwpfvue's People

Contributors

dlbst avatar

Stargazers

Yangs avatar  avatar Manfredi avatar Joe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.