or
Public Class SendButton Inherits System.Windows.Controls.Button<ResourceDictionary xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"> <Style TargetType="{x:Type Button}"> <Setter Property="telerik:StyleManager.Theme" Value="{x:Static telerik:StyleManager.ApplicationTheme}" /> </Style>theObjectScopeProvider1.myScope = GetNewObjectScope();
// The Error : Could not load file or assembly 'System.Data.SQLite' 'System.Data.SQLite' to class library as usual and it was working when i convert the project from class library to Console application and invoke the scope.AdjustForDynamicLoad function but nothing changed:static public void AdjustForDynamicLoad() { Assembly SQLiteAssembly = Assembly.LoadFile(@"C:\Lib\System.Data.SQLite.DLL"); if( theObjectScopeProvider1 == null ) theObjectScopeProvider1 = new ObjectScopeProvider1(); if( theObjectScopeProvider1.myDatabase == null ) { string assumedInitialConfiguration = "<openaccess>" + "<references>" + "<reference assemblyname='PLACEHOLDER' configrequired='True'/>" + "<reference assemblyname='PLACEHOLDEZ' configrequired='False'/>" + "</references>" + "</openaccess>"; System.Reflection.Assembly dll = theObjectScopeProvider1.GetType().Assembly; assumedInitialConfiguration = assumedInitialConfiguration.Replace("PLACEHOLDER", dll.GetName().Name); //assumedInitialConfiguration = assumedInitialConfiguration.Replace("PLACEHOLDEZ", SQLiteAssembly.GetName().Name); System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument(); xmlDoc.LoadXml(assumedInitialConfiguration); Database db = Telerik.OpenAccess.Database.Get("SQLiteDatabaseConnection", xmlDoc.DocumentElement, new System.Reflection.Assembly[] { dll, SQLiteAssembly. } ); theObjectScopeProvider1.myDatabase = db; } }<telerik:RadClock HorizontalAlignment="Left" Margin="1,7,0,0" Name="radTimeFrom" Culture="sl-SI" VerticalAlignment="Top" Width="166" Height="145"> <telerik:RadClock.Header> <TextBlock Text="From" Foreground="White"/> </telerik:RadClock.Header> </telerik:RadClock><telerik:RadTreeListView.RowStyle> <Style TargetType="{x:Type telerik:TreeListViewRow}"> <!--<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />--> <Setter Property="IsExpanded" Value="True" /> </Style></telerik:RadTreeListView.RowStyle>
<telerik:RadGridView AutoGenerateColumns="False" Margin="5" ShowGroupPanel="False" HorizontalAlignment="Left" Name="DataGridProducts" IsFilteringAllowed="False" ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PageUpdateProductMainFields}},Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Path=Products}" Pasting="DataGridProducts_Pasting" KeyDown="DataGridProducts_KeyDown"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Malzeme Kodu" DataMemberBinding="{Binding ItemStockCode}" Width="150"/> <telerik:GridViewDataColumn Header="Malzeme Adı" DataMemberBinding="{Binding ItemName}" Width="150"/> <telerik:GridViewDataColumn Header="Alış Fiyatı" DataMemberBinding="{Binding IncomePrice}" Width="100"/> </telerik:RadGridView.Columns> </telerik:RadGridView>private DynaList<Product> _Products;public DynaList<Product> Products{ get { if (_Products == null) _Products = new DynaList<Product>(); return _Products; } set { _Products = value; }}public void AddEmptyProduct(){ Product tempProduct = new Product(); Products.Insert(Products.Count, tempProduct);}private void DataGridProducts_Pasting(object sender, Telerik.Windows.Controls.GridViewClipboardEventArgs e){ string nodes1 = Clipboard.GetText(); string[] nodes2 = nodes1.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 1; i < nodes2.Count(); i += 1) { AddEmptyProduct(); }}private void DataGridProducts_KeyDown(object sender, System.Windows.Input.KeyEventArgs e){ if (e.Key == Key.RightShift) { DataGridProducts.CommitEdit(); AddEmptyProduct(); DataGridProducts.SelectedItem = DataGridProducts.Items[Products.Count - 1]; }}<telerik:RadGridView Margin="6,6,1,4" CanUserReorderColumns="False" CanUserDeleteRows="False" CanUserInsertRows="False" IsReadOnly="True" AutoGenerateColumns="False" IsFilteringAllowed="False" SelectionMode="Extended" SelectedItem="{Binding PersoanaSelectata, Mode=TwoWay}" ItemsSource="{Binding Persoane, Mode=TwoWay}" Name="radGridViewPersoane" ShowGroupPanel="False" > <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Nume" DataMemberBinding="{Binding Nume}" Width="4*" TextWrapping="Wrap" IsReadOnly="True"/> <telerik:GridViewDataColumn Header="Prenume" DataMemberBinding="{Binding Prenume}" Width="4*" TextWrapping="Wrap" IsReadOnly="True"/> </telerik:RadGridView.Columns> </telerik:RadGridView>private VerificarePersoana _verificarePersoana; public VerificarePersoana VerificarePersoana { get { if (_verificarePersoana == null) _verificarePersoana = new VerificarePersoana(); return _verificarePersoana; } set { _verificarePersoana = value; Notify("VerificarePersoana"); } } private ObservableCollection<Persoana> persoane; public ObservableCollection<Persoanaa> Persoane { get { if (_verificarePersoana.Persoane == null) { _verificarePersoana.Persoane = new ObservableCollection<Persoana>(); } return _verificarePersoana.Persoane; } set { _verificarePersoana.Persoane = value; Notify("Persoane"); } }private string _nume;public string Nume { get { return _nume; } set { _nume = value; Notify("Nume"); }}private string _prenume;public string Prenume { get { return _prenume; } set { _prenume=value; Notify("Prenume"); } }
public void Notify(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
