Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

columbos14927

@columbos14927
About
Posts
72
Topics
54
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Entity framework
    C columbos14927

    Hello, I am a new in EF. I have a Customewr class:

    public class Customer
    {
    public int CustomerId { get; set; }
    public string Name { get; set; }
    public string Email { get; set; }
    }

    And here is my DbContext class:

    public class DiveShopContext:DbContext
    {
    public DbSet<Customer> Customers { get; set; }
    }

    I want to be able to save Customers to my DB, i do it as follow:
    <pre lang="cs">class Program
    {
    static void Main(string[] args)
    {
    using (var db = new DiveShopContext())
    {

           var customer = new Customer();
           customer.CustomerId = 3045;
           customer.Name = &quot;Alex&quot;;
    
           db.Customers.Add(customer);
           db.SaveChanges();
       }
    }
    

    }</pre>

    Every thing is saved fine but the CustomerId is changed from 3045 to 1 and saved.

    Database database sales

  • Mouse up/down events
    C columbos14927

    Hello, I have something strange, i have defined two Event Triggers with atched commands in my button:

    LEFT MOUSE BUTTON SCENARIO: When i use those Events:MouseLeftButtonDown ,MouseLeftButtonUp the StartCommand invoked when i press(with left mouse button) down the button but when i relese the mouse the stop command is not invoked. RIGHT MOUSE BUTTON SCENARIO: When i use those Events:MouseRightButtonDown ,MouseRightButtonUp the StartCommand invoked when i press(with right mouse button) down the button and the StopCommand invoked when i release the button as expected. What is the problem why the StopCommand is not invoked? How can i fire off a command when a button is pressed(with left mouse button) and fire off another command when the button released? Thanks

    WPF question help announcement

  • Save/Load view configuration to/from xml file
    C columbos14927

    Hello, I have the next view XAML file:

    The ItemsControl binded to:

    public ObservableCollection<UserControl> MemControls
    {
    get { return _memControls; }
    set { _memControls = value; }
    }

    in the view Model. I want to give the user an option to save GUI configuration. So when he press "Save" button i want to serialize the:

    public ObservableCollection<UserControl> MemControls

    to XML file and when he want to restore GUI configuration i want to to desirialize from an XML file the list of controls and that way to restore GUI configuration.

    How can i do it?
    Maybe there is some other better way that dont involve XML files?

    Thanks

    WPF question wpf xml workspace

  • MVVM pattern
    C columbos14927

    Hello, Im already a bit familiar with the MVVM pattern, i still have a few question: 1.When i need Model class in addition to the ViewModel class? 2.If i use the Model class how do i connect the Model and the ViewModel(Binding,events), what is the right way? 3.Where to validate the data in the Model or the ViewModel class? I know that probabaly there isn't one way to go but what are the rules of thumb? Thanks.

    WPF question wpf wcf regex architecture

  • TreeView
    C columbos14927

    Thanks!!!

    WPF wpf tutorial csharp winforms regex

  • TreeView
    C columbos14927

    Thanks for the answer, One question though, if i will set the an instance of my control inside the VM ,that means that my VM has to know about the different controls,doesn't it against the MVVM pattern concept(the view is isolated from the model,the view have reference to VM but not the other way around)? Thanks

    WPF wpf tutorial csharp winforms regex

  • TreeView
    C columbos14927

    Hello, On my WPF App in the main window i have a treeview control on the left and a border control on the right, I want to display different user controls in the border according to selected item in the treeview using MVVM pattern. Didn't find any good example, can any one guide me? Thanks

    WPF wpf tutorial csharp winforms regex

  • Reorder the columns in a data grid
    C columbos14927

    Hello, I defined the next data grid:

    <toolkit:DataGrid
    ItemsSource="{Binding LogList}">
    </toolkit:DataGrid>

    And when in my view model file i update the LogList the data in the data grid is also uopdated everything is fine. But there is one problem the automaticly generated columns are not in the order that i would like them to be. How can i fix it? Thanks

    WPF help question css wpf wcf

  • Data binding problem
    C columbos14927

    Hello, I have a Window and a viewModel class as a data context of the window. When i try to change some variables in the viewModel class that are binded to Window properties. I get the next exception: "Cannot use a DependencyObject that belongs to a different thread than its parent Freezable". I know that in WPF you dont have access to a UI elements properties from other threads but here i dont directly access the UI element properties i access some variables that are binded to them. how can i solve this?

    WPF wpf question csharp wcf design

  • One data context for multiple Controls
    C columbos14927

    Thanks!!!

    WPF question

  • One data context for multiple Controls
    C columbos14927

    Hello, I have a window and a user control in side of the window. I want to set the same ViewModel class as a data context for both,the window and the user control. how can i do it? Thanks

    WPF question

  • Data binding validation
    C columbos14927

    Hey, No it doesn't work. The problem is when i switch to another tab and the come back the red Ellipsis disappear. Thanks.

    WPF wpf help wcf question

  • Data binding validation
    C columbos14927

    Hello, I have a tab control with two tabs in it,in each tab i have text boxes, the data of the text boxes is being validated using the IDataErrorInfo interface. If there is an invalid data i am rendering a red ellipsis and a tool tip box using this XAML code:

    Text box XAML:

    The problem is when i go to another tab and then come back again the red Ellipses are disappear. Help any one? Thanks

    WPF wpf help wcf question

  • Working with data bases
    C columbos14927

    Hello, I have a begginers design issue. I'm building an layered application(Presentation layer, Business logic layer and Data base layer). I have three entities in my application:customer,staff member and vendor that all of them deriving from person. The user can add new customer,staff member or vendor to the data base(using UI). My question is which layer is responsible for the next tasks: 1.Validating user data 2.Saving customer,staff member,vendor in to the DB. 3.Retrieving customer,staff member,vendor from the DB. 4.Perform other DB related manipulation with customer,staff member,vendor. 5.Which classes i need to define to perform the above tasks. I'm new in to object oriented programming so thru the current question i am trying to understand the concept. Thanks

    Design and Architecture design database business sales oop

  • Creating column of type enum
    C columbos14927

    Hello, I'm using VS2010 to create Data Base in SQL server. I want to create column that will be of type enum. For example the enum:

    public enum Equipment
    {
    Tank,
    Suit,
    Fins,
    Mask,
    Snorkel
    }

    And the column will be called DiveKit, the values in that column can be one of the Equipment enumeration members. Thanks

    Database database sql-server sysadmin tutorial

  • Stack panel
    C columbos14927

    Hello, I want to add dynamically many controls to a window. I wanted to use a stack panel container but a stack panel has either horizontal or vertical orientation. I want to add the control horizontally and when there are three user controls in one row i want to go to next row and start adding the controls there and so on. The user can also delete a control so the other controls have to be reorganized automatically. Any one has an idea how to do it? Thanks.

    WPF winforms docker data-structures tutorial question

  • Auto complete text box problem
    C columbos14927

    Hello, Im using the

    System.Windows.Controls.AutoCompleteBox

    Here is my XAML code:

    And here is my code behind the XAML:

    public partial class MainWindow : Window
    {
    private List myList;

        public List MyList
        {
            get { return myList; }
        }
    
        public MainWindow()
        {
            InitializeComponent();
    
            myList = new List
                             {
                                 "Macedonia",
                                 "Madagascar",
                                 "Malawi",
                                 "Malaysia",
                                 "Maldives",
                                 "Mali",
                                 "Malta",
                                 "Marshall Islands",
                                 "Mauritania",
                                 "Mauritius",
                                 "Mexico",
                                 "Micronesia",
                                 "Moldova",
                                 "Monaco",
                                 "Mongolia",
                                 "Montenegro",
                                 "Morocco",
                                 "Mozambique",
                                 "Myanmar"
                             };
            //autocompleteBox.ItemsSource = myList;
        }
    }
    

    When i ran this code the auto complete text box doesn't auto completes. But when i uncomment this line:

    //autocompleteBox.ItemsSource = myList;

    And removed this one:

    ItemsSource="{Binding MyList}"

    From the XAML, the auto complete text box works fine. What i'm missing? Thanks

    WPF wpf wcf help question

  • Auto complite text box
    C columbos14927

    Hello, I'm using VS 2010 professional, .NET 4 I'm looking for auto complete text box i have seen this article:http://stackoverflow.com/questions/2338690/wpf-autocomplete-textbox-again[^] I followed the instruction but the auto complete text box doesnt appear in the tool box. Can any body help me? Thanks

    WPF csharp visual-studio wpf com help

  • Building a GUI in WPF
    C columbos14927

    Hello, I have a general question: I'm building a WPF application. I have a main window, in the window i have some constant header and footer and between them there is an area with changing content(work area). During application lifetime different controls created inside the work area and the controls creates small windows. I ran into a problem when i wanted to send an event from one of the windows to some control,the problem was that the window didn't have a reference to the control. So i started to think maybe i did some bad design work and there is some way to create and manage my multiply controls and windows so the interaction between them will be easier. Any one can help me with this one? Thanks

    WPF help question csharp wpf design

  • Constant header and footer
    C columbos14927

    Hello, I'm building WPF(MDI) application. I want my main window to have some constant header and footer(like in a browser) and the area between the header and the footer will change dynamically. I googled but didn't find any thing useful, can someone help on this one? Thanks

    WPF csharp wpf help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups