protected ViewModelBase()
 {
     if (!IsInDesignTime)
     {
         Service = Creator.GetCreator().CreateInstance();
         Load();
     }
 }
 protected ViewModelBase()
 {
     if (!IsInDesignTime)
     {
         Service = Creator.GetCreator().CreateInstance();
         Load();
     }
 }
 public IAutoReservationService GetService()
 {
     if (target == null)
     {
         ChannelFactory<IAutoReservationService> channelFactory = new ChannelFactory<IAutoReservationService>("AutoReservationService");
         target = channelFactory.CreateChannel();
     }
     return target;
 }
Exemple #4
0
        protected ViewModelBase()
        {
            dispatcher = Dispatcher.CurrentDispatcher;

            if (!IsInDesignTime)
            {
                Service = Creator.GetCreator().CreateInstance();
                Load();
            }
        }
Exemple #5
0
        public AutoReservationRepository(string serverUrl = null)
        {
            if (target == null)
            {
                ChannelFactory <IAutoReservationService> channelFactory = new ChannelFactory <IAutoReservationService>("AutoReservationService");
                target = channelFactory.CreateChannel();
            }

            // TODO: Repair Real connection
            _autos         = new ObservableCollection <ChangeTracker <AutoDto> >(target.GetAllCars().Select(auto => new ChangeTracker <AutoDto>(auto)));
            _kunden        = new ObservableCollection <ChangeTracker <KundeDto> >(target.GetAllCustomers().Select(customer => new ChangeTracker <KundeDto>(customer)));
            _reservationen = new ObservableCollection <ChangeTracker <ReservationDto> >(target.GetAllReservations().Select(reservation => new ChangeTracker <ReservationDto>(reservation)));
        }
        public MainViewModel()
        {
            channelFactory = new ChannelFactory <IAutoReservationService>("AutoReservationService");
            service        = channelFactory.CreateChannel();

            // tmp
            // needSomeDummyData();
            showMyData();

            Reservation = new ObservableCollection <ReservationDto>(service.GetAllReservationDtos());
            Kunden      = new ObservableCollection <KundeDto>(service.GetAllKundenDtos());
            Autos       = new ObservableCollection <AutoDto>(service.GetAllAutoDtos());
            // marke noch to string machen für die liste... nur für die liste
            // Autos.ForEach(a => a.Marke = a.Marke.ToString())
            //(Toms antwort) --> AutoDto.Marke ist ein string ?!!=?

            SelectedAuto  = new AutoDto();
            SelectedKunde = new KundeDto();
        }
 public void Init()
 {
     Service = factory.GetService();
     Load();
 }
 protected ViewModelBase(IAutoReservationService svc)
 {
     _dispatcher = Dispatcher.CurrentDispatcher;
     Service     = svc;
     Load();
 }
 protected ViewModelBase()
 {
     _dispatcher = Dispatcher.CurrentDispatcher;
     Service     = Creator.GetCreatorInstance().CreateBusinessLayerInstance();
     Load();
 }
 public void Init()
 {
     Service = factory.GetService();
     Load();
 }