Click here to Skip to main content
15,913,685 members
Home / Discussions / C#
   

C#

 
AnswerRe: LINQ error string matching? Pin
Richard Deeming6-Mar-17 5:36
mveRichard Deeming6-Mar-17 5:36 
GeneralRe: LINQ error string matching? Pin
Member 28240516-Mar-17 20:28
Member 28240516-Mar-17 20:28 
QuestionWorking with .resx Files / C#, WinForms [Closed] Pin
HobbyProggy5-Mar-17 21:44
professionalHobbyProggy5-Mar-17 21:44 
AnswerRe: Working with .resx Files / C#, WinForms Pin
Gerry Schmitz6-Mar-17 9:42
mveGerry Schmitz6-Mar-17 9:42 
GeneralRe: Working with .resx Files / C#, WinForms Pin
HobbyProggy6-Mar-17 19:27
professionalHobbyProggy6-Mar-17 19:27 
GeneralRe: Working with .resx Files / C#, WinForms Pin
Gerry Schmitz6-Mar-17 20:08
mveGerry Schmitz6-Mar-17 20:08 
GeneralRe: Working with .resx Files / C#, WinForms Pin
HobbyProggy6-Mar-17 20:24
professionalHobbyProggy6-Mar-17 20:24 
GeneralRe: Working with .resx Files / C#, WinForms Pin
Gerry Schmitz6-Mar-17 20:41
mveGerry Schmitz6-Mar-17 20:41 
GeneralRe: Working with .resx Files / C#, WinForms Pin
HobbyProggy6-Mar-17 21:45
professionalHobbyProggy6-Mar-17 21:45 
GeneralRe: Working with .resx Files / C#, WinForms Pin
Gerry Schmitz6-Mar-17 22:02
mveGerry Schmitz6-Mar-17 22:02 
GeneralRe: Working with .resx Files / C#, WinForms Pin
HobbyProggy6-Mar-17 22:13
professionalHobbyProggy6-Mar-17 22:13 
GeneralRe: Working with .resx Files / C#, WinForms Pin
Gerry Schmitz6-Mar-17 22:30
mveGerry Schmitz6-Mar-17 22:30 
Questionwebrequest sent twice Pin
Forest44734-Mar-17 22:32
Forest44734-Mar-17 22:32 
AnswerRe: webrequest sent twice Pin
Michael_Davies4-Mar-17 22:59
Michael_Davies4-Mar-17 22:59 
GeneralRe: webrequest sent twice Pin
Forest44734-Mar-17 23:15
Forest44734-Mar-17 23:15 
GeneralRe: webrequest sent twice Pin
Michael_Davies4-Mar-17 23:43
Michael_Davies4-Mar-17 23:43 
AnswerRe: webrequest sent twice Pin
Richard Deeming5-Mar-17 23:52
mveRichard Deeming5-Mar-17 23:52 
GeneralRe: webrequest sent twice Pin
Forest44735-Mar-17 23:59
Forest44735-Mar-17 23:59 
GeneralRe: webrequest sent twice Pin
Forest44736-Mar-17 2:59
Forest44736-Mar-17 2:59 
Questionoptimizing xml reading code in C# Pin
Member 130276784-Mar-17 17:27
Member 130276784-Mar-17 17:27 
AnswerRe: optimizing xml reading code in C# Pin
Pete O'Hanlon4-Mar-17 20:45
mvePete O'Hanlon4-Mar-17 20:45 
QuestionImplementing common control library for both the WPF and UWP version of an application Pin
macika1234-Mar-17 11:08
macika1234-Mar-17 11:08 
Hello,
this might not be a real question, more like an interest about, how bad my current workaround is. I hope it's OK to post here Smile | :) .

I have an application which I have started developing for WPF and now I also want to port it to UWP. I have created some custom visual controls for the app in a Controls library, which is a Class Library in C# and references .Net WPF libraries.

Some custom panels would look very similar with code working in both frameworks, so I thought it would be nice to reuse my old code.

This is the solution I came up and currently porting the library to:
- left the original Controls class library project untouched
- created a Controls.UWP class library for UWP platform
- added source files from Controls to Controls.UWP as linked files
- finally - and currently working on - resolving the namespace changes by adding stuff like this at the beginning of source files:
C#
#if WINDOWS_UWP
using Windows.Foundation;
#else
using System.Windows;
#endif

However, in some cases I must completely rewrite the class eg. because I used OnRender function to draw it, so now I have to rewrite it to use Win2D. For this reason I don't know if it's worth bother with #if statements.

What do you think, is this a bad idea?
AnswerRe: Implementing common control library for both the WPF and UWP version of an application Pin
Pete O'Hanlon4-Mar-17 20:29
mvePete O'Hanlon4-Mar-17 20:29 
GeneralRe: Implementing common control library for both the WPF and UWP version of an application Pin
macika1235-Mar-17 2:26
macika1235-Mar-17 2:26 
GeneralRe: Implementing common control library for both the WPF and UWP version of an application Pin
Pete O'Hanlon5-Mar-17 21:33
mvePete O'Hanlon5-Mar-17 21:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.