Search Results

Search found 13 results on 1 pages for 'orangecl4now'.

Page 1/1 | 1 

  • WPF MVVM Pattern, ViewModel DataContext question

    - by orangecl4now
    I used this side to create my demo application http://windowsclient.net/learn/video.aspx?v=314683 The site was very useful in getting my started and in their example, they created a file called EmployeeRepository.cs which appears to be the source for the data. In their example, the data was hard-wired in code. So I'm trying to learn how to get the data from a data source (like a DB). In my specific case, I want to get the data from a Microsoft Access DB. (READ ONLY, So I'll only use SELECT commands). using System.Collections.Generic; using Telephone_Directory_2010.Model; namespace Telephone_Directory_2010.DataAccess { public class EmployeeRepository { readonly List<Employee> _employees; public EmployeeRepository() { if (_employees == null) { _employees = new List<Employee>(); } _employees.Add(Employee.CreateEmployee("Student One", "IT201", "Information Technology", "IT4207", "Building1", "Room650")); _employees.Add(Employee.CreateEmployee("Student Two", "IT201", "Information Technology", "IT4207", "Building1", "Room650")); _employees.Add(Employee.CreateEmployee("Student Three", "IT201", "Information Technology", "IT4207", "Building1", "Room650")); } public List<Employee> GetEmployees() { return new List<Employee>(_employees); } } } I found another example where an Access DB is used but it doesn't comply with MVVM. So I was trying to figure out how to add the DB file to the project, how to wire it up and bind it to a listbox (i'm not that far yet). Below is my modified file using System.Collections.Generic; using Telephone_Directory_2010.Model; // integrating new code with working code using Telephone_Directory_2010.telephone2010DataSetTableAdapters; using System.Windows.Data; namespace Telephone_Directory_2010.DataAccess { public class EmployeeRepository { readonly List<Employee> _employees; // start // integrating new code with working code private telephone2010DataSet.telephone2010DataTable employeeTable; private CollectionView dataView; internal CollectionView DataView { get { if (dataView == null) { dataView = (CollectionView) CollectionViewSource.GetDefaultView(this.DataContext); } return dataView; } } public EmployeeRepository() { if (_employees == null) { _employees = new List<Employee>(); } telephone2010TableAdapter employeeTableAdapter = new telephone2010TableAdapter(); employeeTable = employeeTableAdapter.GetData(); this.DataContext = employeeTable; } public List<Employee> GetEmployees() { return new List<Employee>(_employees); } } } I get the following error messages when building Error 1 'Telephone_Directory_2010.DataAccess.EmployeeRepository' does not contain a definition for 'DataContext' and no extension method 'DataContext' accepting a first argument of type 'Telephone_Directory_2010.DataAccess.EmployeeRepository' could be found (are you missing a using directive or an assembly reference?) C:\Projects\VS2010\Telephone Directory 2010\Telephone Directory 2010\DataAccess\EmployeeRepository.cs 23 90 Telephone Directory 2010

    Read the article

  • C# Deleting Locked Files & Folders

    - by orangecl4now
    Hello I am writing an application that updates some drivers. However the drivers are "in use" and can't be deleted unless I restart my computer. So how can I write an application to delete these locked drivers without restarting the PC. IF Restarting MUST occur then how can I relaunch my application automatically when the computer restarts and delete those files?

    Read the article

  • how do I copy UITextField data into a UILabel

    - by orangecl4now
    I have a textfield and a label. When you touch the textfield, the keyboard appears In IB, the textfield's properties are Keyboard: ASCII Capable Return Key: Done I wired the IBOutlet to the label and the textfield. How do I get the keyboard to go away when I'm done entering text. How do I get to copy the text to the UIlabel? thanks

    Read the article

  • I want to support UIInterfaceOrientationLandscapeRight and UIInterfaceOrientationLandscapeLeft only

    - by orangecl4now
    how do I make sure that UIInterfaceOrientationPortraitRight and UIInterfaceOrientationPortraitLeft are not supported. Basically I want my application to be used ONLY in UIInterfaceOrientationLandscapeRight and UIInterfaceOrientationLandscapeLeft I edited the Info.plist file MainWindow UISupportedInterfaceOrientations UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight

    Read the article

  • Why doesn't this code work?

    - by orangecl4now
    SignView *tempVC = [[SignView alloc] initWithNibName:@"SignView" bundle:Nil]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationTransition: UIViewAnimationTransitionCurlUp forView:self.view cache:YES]; [UIView setAnimationDelay:0.5f]; [UIView setAnimationDuration:2.0f]; [UIView commitAnimations]; [self presentModalViewController:tempVC animated:YES]; [tempVC passDataWithString:button2.titleLabel.text andColor:currentlySelectedColor isNightModeOn:nightMode.on]; The view slides up instead of Curling up. What am I doing wrong?

    Read the article

  • how do I set a delegate in a view that is not my main view

    - by orangecl4now
    I have a xib. the xib has a button that swaps another xib. the second xib has a uitextfield and a uilabel. how do I make the keyboard go away when I'm done typing? what do I need to wire or code? the second xib has it's own class (called CustomSign.m) Inside CustomSign.m, I've implemented the following method -(void)textFieldDidEndEditing:(UITextField *)textField { [customText resignFirstResponder]; signedLabel.text = customText.text; } - (void)awakeFromNib { //assume textField is an ivar that is connected to the textfield in IB [customText setDelegate:self]; } I get the following warning Class "CustomSign" does not implement the UITextFieldDelegate protocol

    Read the article

  • How do I connect a dataGrid to a DataSet

    - by orangecl4now
    using System.Windows; namespace Telephone_Directory { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); telephone2010DataSet dataSet = new telephone2010DataSet(); telephone2010DataSetTableAdapter adapter = new telephone2010DataSetTableAdapter(); } } } The above is my code is a new project. Visual Studio 2010 complains that " the type or namespace 'telephone2010DataSetTableAdapter' could not be found." I created a new solution. I right clicked the solution name and selected "Add Existing Item" and located my Microsoft Access DB file. I followed the wizard and it setup the necessary XSD files. I started coding and I got this message. I did a little google-ing and I cant figure it out. This is a WPF application created with Visual Studio 2010.

    Read the article

  • How do I use a DataGrid to display the contents of a MDB

    - by orangecl4now
    I'm relatively new to .Net 4 and I am creating my FIRST WPF application using a MDB as a backend datasource. I designed my UI. I have a TextField (called Name), a Combobox (called Division) and a DataGrid (called dataGrid1). The only problem I'm having is figuring out how to link my DataGrid to display data from the DataSource. and load the data in the Windows1_Loaded method. Thanks

    Read the article

1