I am new in wpf MVVM. i want to developed a simple application that have a login window and Main Window. When user can login success then open the main window, If user can wrong input then show a message box for alert
I've had same problem, and this link saved me a lot of time...
I forgot to mention, you have to use MVVMLight Library which also saved me a lot of code :-D
I hope I've answered your question.
Related
I am trying to make a custom web browser inside an electron application. Using webview (because iframe is not loading some necessary web pages) I can load a web page.
Then trying to write something into the web pageĀ“s input by clicking on the react-simple-keyboard which causes blur event, so input loses focus.
I figured out, that this approach would not work directly, so via ipc communication I am trying to resend the key button value and then set it to the window with const {keyboard} = require("#nut-tree/nut-js"); keyboard.type(args.value);
In my input, above the webview tag, it works like a charm, but I am not able to type inside the webview.
Can anyone help me to solve this problem or does anyone know a perfect solution how to use other OSK in electron app or how to open native windows osk on input focus? Thank you in advance.
I'm not sure how you'd accomplish that with this library. But you can just use Window's default on-screen-keyboard to accomplish that. Here is a link to how enable it. windows support
You should also use a BrowserView instead of a Webview, as the Webview is not guaranteed to be present in future versions and it's API is unstable.
The BrowserView doesn't work like an HTML element though and you should read the docs here.
But anyways, just use the system's default and you should be fine.
Also, if you're interested, I'm developing a web browser with Electron (in fact, I'm currently writing this using that browser) and as far as I can say, it's written pretty simply and anyone should understand most of it, so take a look if you're in trouble. But I am no expert and you shouldn't rely on my code as a standard of any kind, really.
Well, I might have just found an answer for you.
Firstly, as I mentioned, you should use a BrowserView instead of webView for your external content, and this time it is a requirement for this method to work. I would create a BrowserWindow with the controls at the top, then place a BrowserView to act as a "browser" and create another BrowserView at the bottom and load in the keyboard html file. And then, when a key is pressed on the virtual keyboard, you should send an ipc message to the main script with the information of what key was pressed(it should be done via a preload script for the OSK BrowserView). In the main script, once you recieve the ipc message (via ipcMain.on()) you should then send an input event to the BrowserView containing your external content. That's done by calling contents.sendInputEvent(Event), so it has to be a main script. Here is a link to contents.sendInputEvent(Event), BrowserView (link) and preload script as well as ipc communication (link).
As for invoking the keyboard once you click on the input element, you could probably do it with a preload script for your "browser's" BrowserView, if you can find how you can check whether the focused element is an input element or something like that, and call an ipc message to then hide or show the keyboard. (Hiding and shwoing the keyboard could be done by calling BrowserWindow.addBrowserView(BrowserView) or BrowserWindow.removeBrowserView(BrowserView). But you would have to search the documentation yourself for those methods as I can't write anymore right now. Documentation could anwser any of your questions if you search for it there.
I wanted to know what would be the best route in mimicking the feature of snapchat of an application being aware of a user screenshotting the page?
By the question I assume you are facing the problem of detecting a screenshot. We can monitor the clipboard and detect the application running in foreground. In case of any snipping tool, the screenshot goes to the clipboard and we can paste it directly.
I am developing a little extensions called "Tab Bundler", which in short saves all the open tabs in a window into a bundle that can be opened with the click of a button. When a bundle is opened however, no history of how the user got to that url is saved, ie. the user can't click back to see how they got to that url. This is functionality I want to implement. I looked for a while, googling, looking thoroughly through the google chrome extension documentation: http://code.google.com/chrome/extensions/history.html. But I couldn't figure out how to get this information without tracking it myself. Is that the only option I have? Any thoughts would be really appreciated.
Thanks!
Look, many people tried this before. You are not alone in this quest!
At the moment the answer in Google Code was: anybody asked for it when they where developing the History API. Then there's no elegant way to access tabs' history.
Of course, you can hook chrome.tabs.onUpdated to record every page and make your own tab's history...
You could probably hook chrome.tab.onUpdate as well as some state or focus change hook to correlate.
I really want this, please make it!
I have a very basic jquery mobile modal dialog that INTERMITTENTLY reloads on clicking "close". This happens across all devices but not on desktop browsers.
The close button always works, but the dialog will pop back up randomly.
Anyone esle experience this. I'd post this on the jquery mobile forum but new registration is broken right now.
So, it's code related but the code won't tell you the what the problem is. The close button on the dialog was directly over the dialog's open button. So when you pressed close, the button beneath it was also being activated to open the dialog again. I moved the position of the close button to not be on top of the open button and that solved it. However, the bigger issue is having touch events read through all layers.
I need to create a popup handler that opens an external window. How can I do this? The default opens the popup in the same webview, and there is no code in the JavaFx learning trail to provide me a general idea or anything. The origin of the popup request comes from a skype button widget. When the user clicks the widget a new "window" (stage) needs to open and the popup must be included within the new stage. The stage is just a composition of a Webview and its engine.
This should happen if the user does not have skype. If the user has skype then skype should open and connect the phone call. Neither is happening.
Update: I also asked in the JavaFx 2.0 forum and got an answer. Here it is. (I'll move it to the Answer area as soon as I can):
https://forums.oracle.com/forums/thread.jspa?threadID=2323123&tstart=0
It still wont open skype and connect for a phone call or open a popup to install skype.
Although the Javascript widget does open skype and connects for a phone call if I open the widget inside a browser in standalone mode.
Therefore it is an issue with the JavaFx 2.0 web app.
Any help is greatly appreciated.
AFAIK, to make calls from the browser Skype needs plugin named "Click to Call" to be installed into the browser.
But there is no such plugin for JavaFX WebView, so you can't have Skype "click-to-call" functionality inside webview.