No overload for '_initCompleted' matches delegate 'System.AsyncCallbac
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using System.Threading;
using System.Windows.Threading;
//Namespace iContract.UI
public partial class SplashWindow
{
private static AsyncCallback InitCompleted;
private static IAsyncResult result;
private void SplashWindow_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
InitCompleted = _initCompleted;
iContract.Application test = new iContract.Application();
result = test.dLoadSplash.BeginInvoke(this, InitCompleted, null);
//result = My.Application.dLoadSplash.BeginInvoke(Me, InitCompleted, Nothing)
}
private void _initCompleted()
{
iContract.Application test = new iContract.Application();
test.dLoadSplash.EndInvoke(result);
//My.Application.dLoadSplash.EndInvoke(result)
Dispatcher.BeginInvoke(new Action(_closeWindow), System.Windows.Threading.DispatcherPriority.Normal, null);
}
private void _closeWindow()
{
Close();
}
public void SetProgress(double val)
{
Dispatcher.BeginInvoke(new Action<double>(_SetProgress), System.Windows.Threading.DispatcherPriority.Normal, val);
}
private void _SetProgress(double val)
{
prog.Value = val;
}
}
this in vb.net when its working
Imports System
Imports System.Collections.Generic
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Windows
Imports System.Threading
Imports System.Windows.Threading
'Namespace iContract.UI
Partial Public Class SplashWindow
Private Shared InitCompleted As AsyncCallback
Private Shared result As IAsyncResult
Private Sub SplashWindow_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
InitCompleted = AddressOf _initCompleted
Dim test As New iContract.Application
result = test.dLoadSplash.BeginInvoke(Me, InitCompleted, Nothing)
'result = My.Application.dLoadSplash.BeginInvoke(Me, InitCompleted, Nothing)
End Sub
Private Sub _initCompleted()
Dim test As New iContract.Application
test.dLoadSplash.EndInvoke(result)
'My.Application.dLoadSplash.EndInvoke(result)
Dispatcher.BeginInvoke(New Action(AddressOf _closeWindow), Windows.Threading.DispatcherPriority.Normal, Nothing)
End Sub
Private Sub _closeWindow()
Close()
End Sub
Public Sub SetProgress(ByVal val As Double)
Dispatcher.BeginInvoke(New Action(Of Double)(AddressOf _SetProgress), Windows.Threading.DispatcherPriority.Normal, val)
End Sub
Private Sub _SetProgress(ByVal val As Double)
prog.Value = val
End Sub
End Class
'End Namespace

New Topic/Question
Reply



MultiQuote





|