我正在尝试使用VerticalContentAlignment属性垂直居中TextBox 的内容,但它似乎根本没有任何效果.文字保持在顶部.谁能告诉我怎么做?
这是我的代码:
<TextBox Grid.Column="1"
Grid.Row="0"
Width="200"
Height="28"
VerticalAlignment="Center"
VerticalContentAlignment="Center" />
Run Code Online (Sandbox Code Playgroud) 我们正在开发的 Python 应用程序需要一个记录器。一位同事认为应该在每个使用它的类中创建和配置记录器。我的观点是,它应该在应用程序启动时创建和配置,并作为构造函数参数传递。
两种变体都有其优点,我们不确定最佳实践是什么。
我想比较两个动作.与==的比较总是返回false,就像Equals-method一样,即使它是同一个实例.
我的问题是:这真的不可能,还是我做错了?
干杯AC
经过广泛的调试会议后,我发现问题在于我调用了readonly属性的setter.发生这种情况时是否有引发编译器警告的技巧?因为将setter私有标记不起作用.
干杯,
CA
说清楚我的意思:
private readonly List<SomeObject> _budget;
public IEnumerable<SomeObject> Budget
{
get
{
return _budget;
}
}
Run Code Online (Sandbox Code Playgroud)
可以访问
A.Budget=new SomeObject();
Run Code Online (Sandbox Code Playgroud)
没有编译器{错误,警告,消息}
我正在尝试学习Haskell,并希望编写一个小程序,将文件内容打印到屏幕上.当我将其加载到GHCi时,我收到以下错误:
'do'结构中的最后一个语句必须是表达式
我知道这个问题已经在这里被提出了:Haskell - "'do'结构中的最后一个语句必须是一个表达式".
即使我的代码非常相似,我仍然无法弄清楚问题.如果有人能指出我的问题,我会非常感激.
module Main (main) where
import System.IO
import System(getArgs)
main :: IO()
main = do
args <- getArgs
inh <- openFile $ ReadMode head args
printFile inh
hClose inh
printFile :: Handle -> IO ()
printFile handle = do
end <- hIsEOF handle
if end
then return ()
else do line <- hGetLine handle
putStrLn line
printFile handle
Run Code Online (Sandbox Code Playgroud) c# ×2
action ×1
comparison ×1
do-notation ×1
haskell ×1
io ×1
logging ×1
monads ×1
properties ×1
python ×1
silverlight ×1
syntax ×1
xaml ×1