|
How to assign a object from the List in c# linq
|
|
|
|
|
|
Rather than posting all these totally vague questions, your time would be better spent actually studying the programming language(s) that you are interested in using. You will not learn it from here.
|
|
|
|
|
The benefit of asking "clear questions" is that you might get an "answer", instead of another "question" asking you to clarify your question. You must have a lot of time on your hands to be able to deal with just more questions (and no answers).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
how to convert in html value to real values in vb ?
|
|
|
|
|
|
Which grid is faster for 5000 records in vb.net?
1.DataTable
2.Flexigrid
3.Jgrid
|
|
|
|
|
The only way to find out is by running timing tests with your data.
|
|
|
|
|
The question is ridiculous, why are you even considering presenting 5000 record to the user.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Helo everyone!
I have a Storyboard at Window resources as shown below.
<Window.Resources>
<Storyboard
x:Key="NB"
x:Name="NB_resource"
Completed="NB_resource_Completed"
RepeatBehavior="5x">
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="NB_image"
Storyboard.TargetProperty="Source"
Duration="0:0:1.2">
<DiscreteObjectKeyFrame KeyTime="0:0:0">
<DiscreteObjectKeyFrame.Value>
<BitmapImage UriSource="pack://application:,,,/CircleSurrogateButton;component/Images/NB_00.png" />
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
<DiscreteObjectKeyFrame KeyTime="0:0:.3">
<DiscreteObjectKeyFrame.Value>
<BitmapImage UriSource="pack://application:,,,/CircleSurrogateButton;component/Images/NB_01.png" />
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
<DiscreteObjectKeyFrame KeyTime="0:0:.6">
<DiscreteObjectKeyFrame.Value>
<BitmapImage UriSource="pack://application:,,,/CircleSurrogateButton;component/Images/NB_02.png" />
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
<DiscreteObjectKeyFrame KeyTime="0:0:.9">
<DiscreteObjectKeyFrame.Value>
<BitmapImage UriSource="pack://application:,,,/CircleSurrogateButton;component/Images/NB_03.png" />
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</Window.Resources>
The Storyboard can be started with the following string which is placed in regular Button.
<EventTrigger RoutedEvent="PreviewMouseLeftButtonDown">
<BeginStoryboard Storyboard="{DynamicResource NB}" />
</EventTrigger>
A question is How to use a data binding in order to start that Storyboard.
For example:
<DataTrigger Binding="{Binding Start_Storyboard}" Value="true">
<DataTrigger.EnterActions>
<BeginStoryboard Storyboard="{DynamicResource NB}"/>
</DataTrigger.EnterActions>
</DataTrigger>
I've tried to put DataTrigger at different places and I had got nothing besides red squiggles and exception while debugging.
Thanks in advance!
|
|
|
|
|
How to Create auto complete textbox in wpf with ado.net
|
|
|
|
|
|
|
I'm working on a custom installation wizard. From it, I'm calling DISM to install IIS and ASP.Net if they're not installed. All the code in the installer class works fine when called from a console app. I'm now trying to put a simple UI on it.
There are 2 steps. Each step raises the event 'CurrentTaskChanged' with text "Installing IIS" or "Installing ASP.Net", and then during installation it raises a ProgressChanged event to send progress to the UI.
The problem is that none of the UI updates happen until the after the entire install process finishes.
Installer Class Code
public static void Install()
{
InstallIIS();
InstallASPDotNet();
}
private static void InstallIIS()
{
InstallFeature("IIS", "/Online /Enable-Feature /FeatureName:IIS-DefaultDocument /All");
}
private static void InstallASPDotNet()
{
InstallFeature("ASP.Net", "/Online /Enable-Feature /FeatureName:IIS-ASPNET45 /All");
}
private static void InstallFeature(string featureName, string args)
{
try
{
CurrentTaskChanged($"Installing {featureName}");
string dism = Path.Combine(Environment.ExpandEnvironmentVariables("%windir%"), "system32", "dism.exe");
if (Environment.Is64BitOperatingSystem && !Environment.Is64BitProcess)
{
dism = Path.Combine(Environment.ExpandEnvironmentVariables("%windir%"), "sysnative", "dism.exe");
}
var process = new Process();
var startInfo = new ProcessStartInfo
{
UseShellExecute = false,
CreateNoWindow = false,
RedirectStandardOutput = true,
FileName = dism,
Arguments = args
};
process.StartInfo = startInfo;
process.OutputDataReceived += (sender, e) => HandleDISMOutput(e.Data);
process.Start();
process.BeginOutputReadLine();
process.StartInfo.Verb = "runas";
process.WaitForExit();
process.CancelOutputRead();
process.Close();
}
catch (Exception e)
{
throw;
}
}
private static void HandleDISMOutput(object data)
{
if (data != null)
{
var info = data.ToString();
if (info.Contains("%"))
{
info = info.Replace('[', ' ');
info = info.Replace(']', ' ');
info = info.Replace('=', ' ');
info = info.Replace(" ", "");
info = info.Replace("%", "");
double.TryParse(info, out double percent);
ProgressUpdated(percent);
}
}
}
UI Code
private void InstallExecuted()
{
RemoteServicesInstaller.CurrentTaskChanged += CurrentTaskChanged;
RemoteServicesInstaller.ProgressUpdated += ProgressUpdated;
RemoteServicesInstaller.Install();
}
private void CurrentTaskChanged(string action)
{
InstallAction = action;
Debug.Print(action);
}
private void ProgressUpdated(double percent)
{
InstallPercent = percent;
Debug.Print(percent.ToString());
}
The two handlers here at the bottom DO get called - the UI just doesn't update during install. I can see the Debug.Print code sending the percent to the debug console. The UI just doesnt refresh.
Anyone have any thougts? Thanks!
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
It's the usual problem - you're blocking the UI thread until the installation completes.
Move the installation code to a background thread using a BackgroundWorker .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Ya, but the whole thing is in the UI thread. The VM creates the class, then calls it, and along the way events get raised to update - all in the same thread.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
And that's the problem! If you block the UI thread, then the UI won't update.
Move the blocking code to a background thread. The simplest way to do that is using a BackgroundWorker [^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
How to Generate the SSRS report in WPF and explain through the code
|
|
|
|
|
|
How to Delete the multiple records in wpf datagrid using threetier architecture
|
|
|
|
|
Requires multi-select enabled in the data grid and one delete command per selected record.
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
Hi
I have a WPF project working fine in Windows 7, but which has a completely changed layout, when the same project is executed under Windows 10.
Do any of you have experiences with this issue?
I have found out that WPF loads the current theme/skin from the OS, and that this may be the cause of the skewed layout, but I haven't been able to find any whitepapers or guides with information on how to work around this problem.
It is a basic Grid with Stack Panels and Labels in it, if that helps.
Any help/ideas/links would be much appreciated
Kind regards - Jakob
|
|
|
|
|
Hi Jakob,
I had experience with this in the past, but visual changes between two OS versions were usually minor. What do you mean by "completely changed layout"? Can you please elaborate?
As you pointed out, issue is (probably) about the styles and templates. By manually setting the whole style (with template etc.), you should be able to ensure same visual appearance on any (compatible) OS.
|
|
|
|
|
Hi Jimmson
Thank you for replying.
I have been isolating diffent parts of our code, to find the culprit.
We are basically building a custom WPF control runtime, to use it for printing, but since it is never shown on the UI, but sent off to the printer, the WPF framework doesn't perform lay-out on the control.
I understand, that these lines in the code I am trying to get to work on WIN10, are responsible for enforcing the layout functionality in a non-visible control:
fixedPage.Measure(sizeOfCustomControlToPrint);
fixedPage.Arrange(new Rect(new Point(), sizeOfCustomControlToPrint));
fixedPage.UpdateLayout();
if I comment these out in WIN10, it seems to be working, but I would really like to understand why.
Maybe there is a bug in the WIN10 implementation...?
|
|
|
|
|
Have you tried to display this FixedPage in UI to see whether the problem actually is in the FixedPage, or in your custom WPF control runtime?
|
|
|
|