or
private void OnDragInitialize(object sender, DragInitializeEventArgs args)
{
var leg = ((sender as ContentControl).Content as TransportOrderLegViewModel);
// Convert Data to ScheduleView Payload
var appt = new Appointment() { };
if (leg.Planned)
{
appt.Location = "Test";
}
var payload = new ScheduleViewDragDropPayload(null, new List<
IOccurrence
>() { appt });
args.Data = payload;
// Create DragVisual
var cc = new ContentControl();
cc.ContentTemplate = Resources.MergedDictionaries[2]["TOLDragVisualTemplate"] as DataTemplate;
cc.Content = leg;
args.DragVisual = cc;
args.AllowedEffects = DragDropEffects.All;
args.DragVisualOffset = args.RelativeStartPoint;
args.Handled = true;
}
var payload = DragDropPayloadManager.GeneratePayload(null);
var data = ((FrameworkElement)args.OriginalSource).DataContext;
payload.SetData("DragData", data);
args.Data = payload;
Telerik.OpenAccess.FetchOptimization.FetchStrategy fetchStrategy =
new
Telerik.OpenAccess.FetchOptimization.FetchStrategy();
fetchStrategy.LoadWith<SessionData>(ses => ses.sesAPISource);
fetchStrategy.LoadWith<LapData>(lap => lap.mapSessionIdLap);
fetchStrategy.LoadWith<TelemetryData>(tel => tel.mapLapIdTelemetry);
simData.sessionQueryable = from c
in
simData.fluentModelContext.fluentSessions
where c.sesAPISource ==
"MEMAPI"
select c;
//test the iteration through the dataset
foreach
(SessionData thesessions
in
simData.sessionQueryable)
{
logger.Trace(
"Session: "
+ thesessions.sesTime);
foreach
(LapData thelaps
in
thesessions.sesLapData)
{
logger.Trace(
"Lap: "
+ thelaps.ltLapNumber);
int
i = 0;
foreach
(TelemetryData thetel
in
thelaps.ltTelemetryData)
{
i++;
logger.Trace(
"Tel: "
+ thetel.telCurrentTime);
if
(i > 20)
break
; //there is a lot of them
}
}
}
private
IQueryable<SessionData> sessionqueryable;
public
IQueryable<SessionData> sessionQueryable
{
get
{
return
sessionqueryable; }
set
{
if
(sessionqueryable == value)
return
; SetProperty(
ref
sessionqueryable, value); }
}
var workbook = CreateWorkBook(grid, settings);
if (workbook != null)
{
var provider = new XlsxFormatProvider();
using (var output = dialog.OpenFile())
{
provider.Export(workbook, output);
fileName = dialog.FileName;
}
}