Click here to Skip to main content
15,900,461 members
Home / Discussions / C#
   

C#

 
GeneralRe: image processing Pin
Mohammad.Khashei21-Jun-15 21:01
Mohammad.Khashei21-Jun-15 21:01 
GeneralRe: image processing Pin
harold aptroot21-Jun-15 21:11
harold aptroot21-Jun-15 21:11 
GeneralRe: image processing Pin
Mohammad.Khashei21-Jun-15 21:20
Mohammad.Khashei21-Jun-15 21:20 
Questionc# application,USB unplugged in window 8.1 OS Pin
Member 1041346920-Jun-15 22:06
Member 1041346920-Jun-15 22:06 
QuestionI'm using a speech dll to write a simple visual studio ai Pin
Member 1178039920-Jun-15 12:33
Member 1178039920-Jun-15 12:33 
SuggestionRe: I'm using a speech dll to write a simple visual studio ai Pin
Richard MacCutchan20-Jun-15 21:15
mveRichard MacCutchan20-Jun-15 21:15 
AnswerRe: I'm using a speech dll to write a simple visual studio ai Pin
Pete O'Hanlon22-Jun-15 0:05
mvePete O'Hanlon22-Jun-15 0:05 
QuestionCheck SerialPort Exist Modem ? Pin
Member 245846720-Jun-15 4:32
Member 245846720-Jun-15 4:32 
AnswerRe: Check SerialPort Exist Modem ? Pin
OriginalGriff20-Jun-15 4:45
mveOriginalGriff20-Jun-15 4:45 
GeneralRe: Check SerialPort Exist Modem ? Pin
Member 245846720-Jun-15 13:41
Member 245846720-Jun-15 13:41 
Questionany one can help me about good project of c# Pin
ginethon otieno19-Jun-15 22:40
ginethon otieno19-Jun-15 22:40 
AnswerRe: any one can help me about good project of c# Pin
OriginalGriff19-Jun-15 22:46
mveOriginalGriff19-Jun-15 22:46 
QuestionDelay windows power events Pin
Member 1085025319-Jun-15 15:19
Member 1085025319-Jun-15 15:19 
AnswerRe: Delay windows power events Pin
Dave Kreskowiak19-Jun-15 17:34
mveDave Kreskowiak19-Jun-15 17:34 
GeneralRe: Delay windows power events Pin
Member 1085025320-Jun-15 1:11
Member 1085025320-Jun-15 1:11 
GeneralRe: Delay windows power events Pin
Dave Kreskowiak20-Jun-15 5:12
mveDave Kreskowiak20-Jun-15 5:12 
GeneralRe: Delay windows power events Pin
Member 1085025320-Jun-15 5:50
Member 1085025320-Jun-15 5:50 
GeneralRe: Delay windows power events Pin
Dave Kreskowiak20-Jun-15 6:16
mveDave Kreskowiak20-Jun-15 6:16 
GeneralRe: Delay windows power events Pin
Member 1085025320-Jun-15 7:28
Member 1085025320-Jun-15 7:28 
GeneralRe: Delay windows power events Pin
Dave Kreskowiak20-Jun-15 7:38
mveDave Kreskowiak20-Jun-15 7:38 
GeneralRe: Delay windows power events Pin
Member 1085025320-Jun-15 7:59
Member 1085025320-Jun-15 7:59 
GeneralRe: Delay windows power events Pin
Member 1085025320-Jun-15 1:34
Member 1085025320-Jun-15 1:34 
QuestionInheritance Pin
JammoD8719-Jun-15 11:35
JammoD8719-Jun-15 11:35 
Hi,

I want to load a screen with a ViewModel depending on the option selected.

I thought Inheritance would be key here, as a lot of the properties are the same. Below is an extract of the code that I have.

C#
public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            bool isHandheld = false;

            var pdv1 = isHandheld == true ? new PDVHH() : new PDV();

            txtCaseID.Text = pdv1.CaseID;
            txtPDV.Text = isHandheld == true ? pdv1.PDVString : string.Empty;
            txtPDVHH.Text = isHandheld == true ? pdv1.PDVHHString : string.Empty;

        }
    }

    class basePDV
    {
        public string CaseID { get; set; }
    }

    class PDV : basePDV
    {
        public string PDVString { get; set; }
    }

    class PDVHH : basePDV
    {
        public string PDVHHString { get; set; }
    }


The error I am receiving is... "Type of conditional expression cannot be determined because there is no implicit conversion between 'WindowsFormsApplication1.PDVHH' and 'WindowsFormsApplication1.PDV'"

I'm hoping someone can give me some guidance on a solution for this.

Thanks,
Personal Blog: A Software Programmer
Twitter: JammoD

AnswerRe: Inheritance Pin
harold aptroot19-Jun-15 11:44
harold aptroot19-Jun-15 11:44 
GeneralRe: Inheritance Pin
JammoD8719-Jun-15 11:46
JammoD8719-Jun-15 11:46 

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.