11 Replies - 701 Views - Last Post: 27 June 2017 - 05:03 AM

#1 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 5822
  • View blog
  • Posts: 19,818
  • Joined: 05-May 12

It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 24 June 2017 - 06:38 AM

It saddens me that it's 2017 and I'm writing a brand new code using WinForms. It's to future-proof ourselves. (Pun intended.)

The app's primary reason to exist is simply to host a web browser control so that most users of the webpage can get a "no window chrome" experience when displaying a page that should be readily available at a clicks notice. Although we are currently using a minimal number of hooks into the web browser control, to future-proof ourselves we going to use the WinForms WebBrowser instead of the WPF WebBrowser due to it's wider array of APIs and hooks. :(/>

The original idea of using a pure WPF UI talking to web services was nixed because there are also non-Windows users that it would be a duplication of effort to create the web UI and WPF UI. The non-Windows users, of course, are executives. So although the 80-20 rule should apply, executives are the influential 1% that out weigh the 80%.

I suggested using Xamarin to create a multi-OS targeted application with native UI, but there was going to be too much red tape to hack through to get a fast release.

I'm going to take one more stab at using WPF to host the WebBrowser approach by claiming YAGNI. For now the WPF WebBrowser will be sufficient. If in the future deeper web browser hooks are needed, then replace it with the WPF hosting WinForms hosting the WinForms WebBrowser.

Is This A Good Question/Topic? 0
  • +

Replies To: It's 2017. Writing a brand new WinForms app for future-proofing.

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13383
  • View blog
  • Posts: 53,409
  • Joined: 12-June 08

Re: It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 24 June 2017 - 08:14 AM

Meh.. it's a webform and most likely will be functional for another five to ten years. No biggie. It could be worse - vb6 mandate.
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6504
  • View blog
  • Posts: 14,355
  • Joined: 02-June 10

Re: It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 24 June 2017 - 09:08 AM

> there are also non-Windows users
> I suggested using Xamarin to create a multi-OS targeted application
You know that would have been my suggestion

> with native UI,

What parts do you need to be native? You don't need to make the ENTIRE UI native. Xamarin has come a long way in the last couple releases. You can now lay individual native components on a platform agnostic Xamamrin.Form - Makes it really nice. For example on my current app there is a mapping page. Instead of using the generic google map I have placed a 3rd party Android MapFragment and iOS component on the PCL ContentPage. Its an awesome way to have even more shared code while providing native pieces only where needed.
Was This Post Helpful? 0
  • +
  • -

#4 jon.kiparsky  Icon User is offline

  • Screw Trump (before he screws you)
  • member icon


Reputation: 10622
  • View blog
  • Posts: 18,174
  • Joined: 19-March 11

Re: It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 24 June 2017 - 07:08 PM

Pet peeve time: "code" is a mass noun. It doesn't take an article. "I'm writing a code" is like saying "I'm eating an oatmeal".
Was This Post Helpful? 1
  • +
  • -

#5 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 5822
  • View blog
  • Posts: 19,818
  • Joined: 05-May 12

Re: It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 24 June 2017 - 10:39 PM

Typo on my side due to lack of coffee. I originally had written that paragraph to start with "I'm working on a brand new code base written primarily to use WinForms." and then decided to switch to "I'm writing ..."
Was This Post Helpful? 0
  • +
  • -

#6 jon.kiparsky  Icon User is offline

  • Screw Trump (before he screws you)
  • member icon


Reputation: 10622
  • View blog
  • Posts: 18,174
  • Joined: 19-March 11

Re: It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 24 June 2017 - 11:14 PM

Fair enough - all is forgiven!
Was This Post Helpful? 0
  • +
  • -

#7 tlhIn`toq  Icon User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6504
  • View blog
  • Posts: 14,355
  • Joined: 02-June 10

Re: It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 25 June 2017 - 04:20 AM

View Postjon.kiparsky, on 24 June 2017 - 08:08 PM, said:

Pet peeve time: "code" is a mass noun. It doesn't take an article. "I'm writing a code" is like saying "I'm eating an oatmeal".

Unless you are speaking in cryptography terms and meaning a cypher. You can create a code for a coded message.

View Postjon.kiparsky, on 25 June 2017 - 12:14 AM, said:

Fair enough - all is forgiven!


View PostSkydiver, on 24 June 2017 - 11:39 PM, said:

lack of coffee.

I'm not sure that is forgivable.
Was This Post Helpful? 0
  • +
  • -

#8 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 5822
  • View blog
  • Posts: 19,818
  • Joined: 05-May 12

Re: It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 25 June 2017 - 04:57 PM

Unless I'm missing something, I just realized that Xamarin may not be an option for me since the majority of the users will be on Win7. My current scans of Xamarin documentation indicate target various mobile platforms. From quick Google searches, there is a project that is targeting WPF which maybe the way for me to get a version running on Win7.

On the other hand, I have no business logic in the application. All it does is host a browser. I don't think I'm gaining anything with a single shared code base for business logic when I don't have any to speak of.
Was This Post Helpful? 0
  • +
  • -

#9 tlhIn`toq  Icon User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6504
  • View blog
  • Posts: 14,355
  • Joined: 02-June 10

Re: It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 26 June 2017 - 02:34 AM

> All it does is host a browser.

Then why do you need a program AT ALL? Don't you just need to send links out to the users?
Was This Post Helpful? 0
  • +
  • -

#10 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 5822
  • View blog
  • Posts: 19,818
  • Joined: 05-May 12

Re: It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 26 June 2017 - 05:37 AM

They wanted a completely no chrome window along with no address bar. The no chrome is doable with Javascript, but we can't find a way to get around the group policy that forces showing the address bar, and couldn't find a way to get an exception for well known or Intranet zone apps to not show the address bar.

Is there a way to install the link into the system tray? Does IE11 support push notifications now? Although pinned sites on the taskbar almost seems like an alternative, it requires that the browser be constantly running. The only extra bit of functionality beyond hosting the web browser is to simulate push notifications by occasionally polling a web service and popup some toast.
Was This Post Helpful? 0
  • +
  • -

#11 tlhIn`toq  Icon User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6504
  • View blog
  • Posts: 14,355
  • Joined: 02-June 10

Re: It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 27 June 2017 - 03:00 AM

So you just needed a full page webview with nothing else? The URL in a static string in code behind. Joy. There's 30 minutes of your life you won't get back. Bill for the full day and take a long lunch.
Was This Post Helpful? 0
  • +
  • -

#12 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 5822
  • View blog
  • Posts: 19,818
  • Joined: 05-May 12

Re: It's 2017. Writing a brand new WinForms app for future-proofing.

Posted 27 June 2017 - 05:03 AM

If only it were a full screen view. As you said, just some Javascript and run IE in Kiosk mode... Basically they want a medium sized tool palette. Draggable, no window chrome, no address bar, no vestiges of the original IE window that popped up the smaller window. Along with it they want Chrome or Firefox web push notification toast when the window is minimized. Major scope creep...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1