Posts

Showing posts from February 20, 2019

Draw feasible region between constraints (TikZ and pgf) [closed]

Image
2 0 I'm trying to shade the feasible region ABCDE but for some reason, only get a weird line. This is the code: begin{tikzpicture} % axes begin{axis}[axis on top,smooth, axis line style=very thick, axis x line=bottom, axis y line=left, ymin=0,ymax=17,xmin=0,xmax=17, xlabel=$x_1$, ylabel=$x_2$,grid=major ] % constraints draw [name path global=xaxis] (0,0) -- (17,0); draw [name path=yaxis] (0,0) -- (0,17); addplot[name path global=firstline,very thick, domain=0:17]{6-0.5*x}; addplot[name path global=secondline,very thick, domain=0:17]{3+0.5*x}; addplot[name path global=thirdline,very thick, domain=0:17]{16-2*x}; addplot[name path global=fourthline,very thick, domain=0:17]{7}; % feasible area fill[name intersections={of=xaxis and yaxis,by=point1}, name intersections={of=secondline and yaxis,by

How to bind command in ViewModel to a command in Behavior?

Image
0 WPF project + Prism 7 + (Pure MVVM pattern) Simple, I have TextBox which need to be cleared when some button is pressed (without the violation to the MVVM pattern) <Button Command="{Binding ClearCommand}"/> <TextBox Text="{Binding File}"> <i:Interaction.Behaviors> <local:ClearTextBehavior ClearTextCommand="{Binding ClearCommand, Mode=OneWayToSource}" /> </i:Interaction.Behaviors> </TextBox> ViewModel public class ViewModel { public ICommand ClearCommand { get; set; } } Behavior public class ClearTextBehavior : Behavior<TextBox> { public ICommand ClearTextCommand { get { return (ICommand)GetValue(ClearTextCommandProperty); } set { SetValue(ClearTextCom