hi to all
I wanted to know how to update a static boolean value apparetenant to another class in a static method
thanks
variable is = Pages.facteur.Testunite;
private void glyactuunit_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
try
{
//MessageBox.Show(glyactuunit.SelectedItem.ToString());
if (glyactuunit.SelectedItem.ToString() == glyactuunit.Items.ElementAt(1).ToString())
{
MessageBox.Show(glyactuunit.SelectedItem.ToString());
Testunite = true;
}
else
{
MessageBox.Show(glyactuunit.SelectedItem.ToString());
Testunite = false;
}
//glyactu.Text = "0";
}
catch (Exception ex)
{
//MessageBox.Show(ex.Message);
}
}
private static void EnsureSentences()
{
try
{
if (_sentences == null)
{
_sentences = new List<string>();
if (Pages.facteur.Testunite == false)
{
StreamResourceInfo info = Application.GetResourceStream(new Uri("Data/glyactuvaluegr.txt", UriKind.Relative));
if (info != null)
{
Stream stream = info.Stream;
if (stream != null)
{
using (StreamReader reader = new StreamReader(stream))
{
while (!reader.EndOfStream)
{
_sentences.Add(reader.ReadLine());
}
};
}
}
}
else
{
StreamResourceInfo info = Application.GetResourceStream(new Uri("Data/glyactuvaluemmol.txt", UriKind.Relative));
if (info != null)
{
Stream stream = info.Stream;
if (stream != null)
{
using (StreamReader reader = new StreamReader(stream))
{
while (!reader.EndOfStream)
{
_sentences.Add(reader.ReadLine());
}
};
}
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}