Search This Blog

Wednesday, November 13, 2013

Creating my first WPF app, the saga continues

In around 60 hrs I have converted a C# winforms application to WPF.

Biggest challenge encountered was the tree control.
In winforms, tree control uses treenodes.  Not the case at all in WPF.

You use HierarchicalDataTemplate


Pretty cool once you get it working.

Next big challenge,  convert sql server data source to SQLite.
Great project on Code Project

Convert SQL Server DB to SQLite DB - CodeProject


But, it converted my Int32 to Int64.

This caused a problem in the class structures I was deserializing the result sets into.

public class LegoPart : INotifyPropertyChanged
    {
        [DataMember, Column]
        public string ItemNo { get; set; }

        [DataMember, Column]
        public string ParentItemNo { get; set; }

        [DataMember, Column]
        public byte[] Image { get; set; }

        [DataMember, Column]
        public string Description { get; set; }

        [DataMember, Column]
        public object Color { get; set; }

        [DataMember, Column]
        public string ImagePath { get; set; }

        public event PropertyChangedEventHandler PropertyChanged;
    }






Next problem, I encountered is apparently SQLite does not support UNION queries
This was simple to eliminate since the resultset is being converted into IList. I simply created two lists and then combined them.

   list1.AddRange(list2);





No comments: